If someone tries to add a nexthop with a list of nexthops
already attached to it, let's just assert. This standardizes
the API to say we assume this is an individual nexthop
you are appending to a group.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
{
struct nexthop *position, *prev;
- /* Ensure this gets set */
- nexthop->next = NULL;
+ assert(!nexthop->next);
for (position = *head, prev = NULL; position;
prev = position, position = position->next) {
{
struct nexthop *tail;
+ assert(!nexthop->next);
+
/* Try to just append to the end first;
* trust the list is already sorted
*/