[quagga-dev 555] Re: Recent ripng breakage

Hasso Tepper hasso at estpak.ee
Sun Dec 21 07:34:36 GMT 2003


Paul Jakma wrote:
> On Sat, 20 Dec 2003, Greg Troxel wrote:
> > Well, changing behavior to make them meet their defined API is OK
> > if the behavior is wrong.  But I agree that changing longstanding
> > or documented semantics is not ok.
>
> The semantics were clearly broken though, or rather, there were no
> semantics in place /at all/ to deal with the comparator returning
> equal/0. Sowmini's change established the behaviour in the first
> place.

Wrong. Semantics existed - node was added to the end of list in case 
compare returned 0. I agree that it is strange/broken/whatever, but 
it didn't drop node. And that's what I wouldn't change.

> > So I think we are in agreement that the 1.2-1.3 delta should be
> > backed out, and then we can discuss with sowmini.varadhan at sun.com
> > what the issue was that gave rise to:
> >
> > revision 1.3
> > date: 2003/09/23 23:47:14;  author: paul;  state: Exp;  lines: +6
> > -2 2003-09-24 sowmini.varadhan at sun.com
> >
> > 	   * lib/linklist.c: (if_cmp_func) Fix handling of case where
> > 	     list->cmp returns 0.
> >
> > and solve it another way.
>
> I'd rather it not be backed out. I'd rather we fix the users and/or
> consider whether we need to add something to lists to allow them to
> add duplicate entries. Indeed, clean up the damn thing.

I think that givinig to the listnode_add_sort function behavior what 
perfectly makes sense and doesn't brake any code is very trivial. See 
attached patch against CVS. With this patch function does what his 
name says - it adds (name isn't listnode_add_or_drop_sort ;) node to 
the list sorted. It just fixes one little thing which was 
strange/broken - if cmp returned 0, node was added to the end of 
list.

And as I already said previously - if there is need to drop nodes if 
cmp returns 0, check must be done before calling listnode_add_sort() 
or implement listnode_add_sort_nodups() function for example.

-- 
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ht-linklist-20031221.patch
Type: text/x-diff
Size: 954 bytes
Desc: not available
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20031221/47b1cd3e/attachment-0001.bin>


More information about the Quagga-dev mailing list