I'd like to add, having a list that "allows dups" leads to a whole
bunch of questions.
True.
What are the semantics associated with "listnode_delete"?
It seems to delete just the first instance.
A good point. But I believe the way forward is documenting the
current behavior, and treading extremely lightly on changing it.
What are the semantics of "listnode_find" (is the caller expected to
march down the list and diddle all of the node entries that match
the key?)?
One could also argue that a caller that needs to do this should define
an appropriate comparison function. In the ripngd case, the
comparison function is explicitly only on next hop, since that's
apparently what the protocol requires. There is nothing wrong or even
unusual in the ripngd case with having multiple entries with the same
next hop.
> IMO, adding dups is just memory leakage, and sounds like poor design.
> ymmv.
In the ripngd case, there is no evidence that this leads to a memory
leak.
--
Greg Troxel <gdt@ir.bbn.com>
bunch of questions.
True.
What are the semantics associated with "listnode_delete"?
It seems to delete just the first instance.
A good point. But I believe the way forward is documenting the
current behavior, and treading extremely lightly on changing it.
What are the semantics of "listnode_find" (is the caller expected to
march down the list and diddle all of the node entries that match
the key?)?
One could also argue that a caller that needs to do this should define
an appropriate comparison function. In the ripngd case, the
comparison function is explicitly only on next hop, since that's
apparently what the protocol requires. There is nothing wrong or even
unusual in the ripngd case with having multiple entries with the same
next hop.
> IMO, adding dups is just memory leakage, and sounds like poor design.
> ymmv.
In the ripngd case, there is no evidence that this leads to a memory
leak.
--
Greg Troxel <gdt@ir.bbn.com>