]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: rt_socket.c should not use SET_FLAG
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 16 Nov 2017 17:26:07 +0000 (12:26 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 16 Nov 2017 18:13:08 +0000 (13:13 -0500)
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 <sharpd@cumulusnetworks.com>
zebra/rt_socket.c

index 75207a2dde40be0d1ca7954c0bae9edbf2d8c956..e5887949470d6b8e70dc07ee5aa2601ed4947e90 100644 (file)
@@ -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++;
        }