From 84cac51a51fc29349077e8cecadf1aed11f9b824 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 30 Aug 2016 17:17:27 +0200 Subject: Nest: Keep multipath next hops sorted --- proto/static/static.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'proto/static/static.c') diff --git a/proto/static/static.c b/proto/static/static.c index be808593..d54302a8 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -81,7 +81,6 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa) { struct static_route *r2; struct mpnh *nhs = NULL; - struct mpnh **nhp = &nhs; for (r2 = r->mp_next; r2; r2 = r2->mp_next) if (r2->installed) @@ -90,9 +89,7 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa) nh->gw = r2->via; nh->iface = r2->neigh->iface; nh->weight = r2->masklen; /* really */ - nh->next = NULL; - *nhp = nh; - nhp = &(nh->next); + mpnh_insert(&nhs, nh); } /* There is at least one nexthop */ -- cgit v1.2.3