summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-05-14 10:48:26 -0700
committerStephen Worley <sworley@cumulusnetworks.com>2019-05-23 12:21:15 -0400
commit78fba41bd810ce6e8976077c37644e9d23b9f69d (patch)
tree592fd555de7535a972617b94aa57599ae9f325d6
parent2ed74b933dbf980422cc5d4da76b168297e133e6 (diff)
lib,zebra,bgpd: Remove nexthop_same_no_recurse()
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>
-rw-r--r--bgpd/bgp_nht.c3
-rw-r--r--lib/nexthop.c36
-rw-r--r--lib/nexthop.h2
-rw-r--r--zebra/zebra_rib.c2
4 files changed, 2 insertions, 41 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index 7e721db49d..fdfa15b445 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -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)
diff --git a/lib/nexthop.c b/lib/nexthop.c
index 7cc77a7674..123684b512 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -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);
diff --git a/lib/nexthop.h b/lib/nexthop.h
index 1bc3055835..48efc762c5 100644
--- a/lib/nexthop.h
+++ b/lib/nexthop.h
@@ -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);
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 8f27316669..297fc7e7e7 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -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;
}