mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 20:04:11 +00:00
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>
This commit is contained in:
parent
2ed74b933d
commit
78fba41bd8
@ -474,8 +474,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (oldnh = bnc->nexthop; oldnh; oldnh = oldnh->next)
|
for (oldnh = bnc->nexthop; oldnh; oldnh = oldnh->next)
|
||||||
if (nexthop_same_no_recurse(oldnh, nexthop) &&
|
if (nexthop_same(oldnh, nexthop))
|
||||||
nexthop_labels_match(oldnh, nexthop))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!oldnh)
|
if (!oldnh)
|
||||||
|
@ -126,42 +126,6 @@ int nexthop_cmp(const struct nexthop *next1, const struct nexthop *next2)
|
|||||||
return ret;
|
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 nexthop_same_firsthop(struct nexthop *next1, struct nexthop *next2)
|
||||||
{
|
{
|
||||||
int type1 = NEXTHOP_FIRSTHOPTYPE(next1->type);
|
int type1 = NEXTHOP_FIRSTHOPTYPE(next1->type);
|
||||||
|
@ -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 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 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,
|
extern bool nexthop_labels_match(const struct nexthop *nh1,
|
||||||
const struct nexthop *nh2);
|
const struct nexthop *nh2);
|
||||||
extern int nexthop_same_firsthop(struct nexthop *next1, struct nexthop *next2);
|
extern int nexthop_same_firsthop(struct nexthop *next1, struct nexthop *next2);
|
||||||
|
@ -2855,7 +2855,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (ALL_NEXTHOPS(re->ng, rtnh))
|
for (ALL_NEXTHOPS(re->ng, rtnh))
|
||||||
if (nexthop_same_no_recurse(rtnh, nh)) {
|
if (nexthop_same(rtnh, nh)) {
|
||||||
same = re;
|
same = re;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user