summaryrefslogtreecommitdiff
path: root/zebra/rt_socket.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-05-30 16:14:42 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-12 10:05:07 -0400
commit25b9cb0cc834df7966338f76746e90bca8586161 (patch)
tree4ecaf2667b187f715aec7574bbd9e3f5dd0d310a /zebra/rt_socket.c
parent953d97fc4aef0c7715e8d42d7d52ebc18d873ac6 (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_socket.c')
-rw-r--r--zebra/rt_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index d8e37a10c3..75207a2dde 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -136,7 +136,7 @@ static int kernel_rtm_ipv4(int cmd, struct prefix *p, struct route_entry *re)
* other than ADD and DELETE?
*/
if ((cmd == RTM_ADD
- && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
+ && NEXTHOP_IS_ACTIVE(nexthop->flags))
|| (cmd == RTM_DELETE
&& CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB))) {
if (nexthop->type == NEXTHOP_TYPE_IPV4
@@ -314,7 +314,7 @@ static int kernel_rtm_ipv6(int cmd, struct prefix *p, struct route_entry *re)
gate = 0;
if ((cmd == RTM_ADD
- && CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
+ && NEXTHOP_IS_ACTIVE(nexthop->flags))
|| (cmd == RTM_DELETE
#if 0
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)