diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-05-30 16:14:42 +0200 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-09-12 10:05:07 -0400 |
| commit | 25b9cb0cc834df7966338f76746e90bca8586161 (patch) | |
| tree | 4ecaf2667b187f715aec7574bbd9e3f5dd0d310a /zebra/rt_netlink.c | |
| parent | 953d97fc4aef0c7715e8d42d7d52ebc18d873ac6 (diff) | |
zebra: deduplicate nexthops
There exists situations where it is possible to have duplicate
nexthops passed from a higher level protocol into zebra.
This code notices this duplication of nexthops and marks
the duplicates as DUPLICATE so we don't attempt to install
it into the kernel.
This is important on *BSD as I understand it because passing
duplicate nexthops will cause the route to be rejected.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/rt_netlink.c')
| -rw-r--r-- | zebra/rt_netlink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 12b6185395..e59d5f00fb 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1383,7 +1383,7 @@ static int netlink_route_multipath(int cmd, struct prefix *p, if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE)) continue; if (cmd == RTM_NEWROUTE - && !CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) + && !NEXTHOP_IS_ACTIVE(nexthop->flags)) continue; if (cmd == RTM_DELROUTE && !CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB)) @@ -1438,7 +1438,7 @@ static int netlink_route_multipath(int cmd, struct prefix *p, } if ((cmd == RTM_NEWROUTE - && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) + && NEXTHOP_IS_ACTIVE(nexthop->flags)) || (cmd == RTM_DELROUTE && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB))) { @@ -1521,7 +1521,7 @@ static int netlink_route_multipath(int cmd, struct prefix *p, } if ((cmd == RTM_NEWROUTE - && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) + && NEXTHOP_IS_ACTIVE(nexthop->flags)) || (cmd == RTM_DELROUTE && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB))) { |
