]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib,zebra,bgpd: Remove nexthop_same_no_recurse()
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 14 May 2019 17:48:26 +0000 (10:48 -0700)
committerStephen Worley <sworley@cumulusnetworks.com>
Thu, 23 May 2019 16:21:15 +0000 (12:21 -0400)
The functions nexthop_same() does not check the resolved
nexthops so I don't think this function is even needed
anymore.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
bgpd/bgp_nht.c
lib/nexthop.c
lib/nexthop.h
zebra/zebra_rib.c

index 7e721db49dbaf9b6a64711e824ab92e63d5a5b67..fdfa15b445f76995d2f5989baf6e90663e114acc 100644 (file)
@@ -474,8 +474,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
                                continue;
 
                        for (oldnh = bnc->nexthop; oldnh; oldnh = oldnh->next)
-                               if (nexthop_same_no_recurse(oldnh, nexthop) &&
-                                   nexthop_labels_match(oldnh, nexthop))
+                               if (nexthop_same(oldnh, nexthop))
                                        break;
 
                        if (!oldnh)
index 7cc77a7674f044136131fc781137f1f7462d802f..123684b512534840a6c243ea7f7bb9f720fc07d9 100644 (file)
@@ -126,42 +126,6 @@ int nexthop_cmp(const struct nexthop *next1, const struct nexthop *next2)
        return ret;
 }
 
-/* check if nexthops are same, non-recursive */
-int nexthop_same_no_recurse(const struct nexthop *next1,
-                           const struct nexthop *next2)
-{
-       if (next1->type != next2->type)
-               return 0;
-
-       switch (next1->type) {
-       case NEXTHOP_TYPE_IPV4:
-       case NEXTHOP_TYPE_IPV4_IFINDEX:
-               if (!IPV4_ADDR_SAME(&next1->gate.ipv4, &next2->gate.ipv4))
-                       return 0;
-               if (next1->ifindex && (next1->ifindex != next2->ifindex))
-                       return 0;
-               break;
-       case NEXTHOP_TYPE_IFINDEX:
-               if (next1->ifindex != next2->ifindex)
-                       return 0;
-               break;
-       case NEXTHOP_TYPE_IPV6:
-               if (!IPV6_ADDR_SAME(&next1->gate.ipv6, &next2->gate.ipv6))
-                       return 0;
-               break;
-       case NEXTHOP_TYPE_IPV6_IFINDEX:
-               if (!IPV6_ADDR_SAME(&next1->gate.ipv6, &next2->gate.ipv6))
-                       return 0;
-               if (next1->ifindex != next2->ifindex)
-                       return 0;
-               break;
-       default:
-               /* do nothing */
-               break;
-       }
-       return 1;
-}
-
 int nexthop_same_firsthop(struct nexthop *next1, struct nexthop *next2)
 {
        int type1 = NEXTHOP_FIRSTHOPTYPE(next1->type);
index 1bc3055835336d5c07e7018e69b6690a1b66ce33..48efc762c55e14b0b320acdc57a03076fb1ca36a 100644 (file)
@@ -142,8 +142,6 @@ extern bool nexthop_same(const struct nexthop *nh1, const struct nexthop *nh2);
 extern int nexthop_cmp(const struct nexthop *nh1, const struct nexthop *nh2);
 
 extern const char *nexthop_type_to_str(enum nexthop_types_t nh_type);
-extern int nexthop_same_no_recurse(const struct nexthop *next1,
-                                  const struct nexthop *next2);
 extern bool nexthop_labels_match(const struct nexthop *nh1,
                                 const struct nexthop *nh2);
 extern int nexthop_same_firsthop(struct nexthop *next1, struct nexthop *next2);
index 8f27316669af3724ecf50badec7ca217681ffed3..297fc7e7e775cf819595d8e2d2920be920186c90 100644 (file)
@@ -2855,7 +2855,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
                                break;
                        }
                        for (ALL_NEXTHOPS(re->ng, rtnh))
-                               if (nexthop_same_no_recurse(rtnh, nh)) {
+                               if (nexthop_same(rtnh, nh)) {
                                        same = re;
                                        break;
                                }