From 2d74d637310ea5532718ce452e2547f283b0cb56 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 16 Nov 2017 12:26:07 -0500 Subject: [PATCH] zebra: rt_socket.c should not use SET_FLAG The SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB) is already taken care of in zebra_rib.c. There is no need for this to be handled by rt_socket.c. rt_netlink.c does not do a SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB) for route installation. Please note it does do it for a mpls labeled route installation, which will be fixed in a future commit. Remove some dead code from 2002 as well. Signed-off-by: Donald Sharp --- zebra/rt_socket.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c index 75207a2dde..e588794947 100644 --- a/zebra/rt_socket.c +++ b/zebra/rt_socket.c @@ -201,9 +201,6 @@ static int kernel_rtm_ipv4(int cmd, struct prefix *p, struct route_entry *re) zlog_debug( "%s: %s: successfully did NH %s", __func__, prefix_buf, gate_buf); - if (cmd == RTM_ADD) - SET_FLAG(nexthop->flags, - NEXTHOP_FLAG_FIB); break; /* The only valid case for this error is kernel's @@ -315,11 +312,7 @@ static int kernel_rtm_ipv6(int cmd, struct prefix *p, struct route_entry *re) if ((cmd == RTM_ADD && NEXTHOP_IS_ACTIVE(nexthop->flags)) - || (cmd == RTM_DELETE -#if 0 - && CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) -#endif - )) { + || (cmd == RTM_DELETE)) { if (nexthop->type == NEXTHOP_TYPE_IPV6 || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { sin_gate.sin6_addr = nexthop->gate.ipv6; @@ -331,9 +324,6 @@ static int kernel_rtm_ipv6(int cmd, struct prefix *p, struct route_entry *re) if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE) bh_type = nexthop->bh_type; - - if (cmd == RTM_ADD) - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB); } /* Under kame set interface index to link local address. */ @@ -371,16 +361,7 @@ static int kernel_rtm_ipv6(int cmd, struct prefix *p, struct route_entry *re) (union sockunion *)mask, gate ? (union sockunion *)&sin_gate : NULL, smplsp, ifindex, bh_type, re->metric); - -#if 0 - if (error) - { - zlog_info ("kernel_rtm_ipv6(): nexthop %d add error=%d.", - nexthop_num, error); - } -#else (void)error; -#endif nexthop_num++; } -- 2.39.5