mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-11-01 12:47:16 +00:00
Nexthop Tracking and Static route fix (#4602)
Nexthop Tracking and Static route fix
This commit is contained in:
commit
b86c7ab7ca
@ -37,8 +37,6 @@ static void static_nht_update_safi(struct prefix *p, uint32_t nh_num,
|
||||
struct static_route *si;
|
||||
struct static_vrf *svrf;
|
||||
struct route_node *rn;
|
||||
bool orig;
|
||||
bool reinstall;
|
||||
|
||||
svrf = vrf->info;
|
||||
if (!svrf)
|
||||
@ -49,7 +47,6 @@ static void static_nht_update_safi(struct prefix *p, uint32_t nh_num,
|
||||
return;
|
||||
|
||||
for (rn = route_top(stable); rn; rn = route_next(rn)) {
|
||||
reinstall = false;
|
||||
for (si = rn->info; si; si = si->next) {
|
||||
if (si->nh_vrf_id != nh_vrf_id)
|
||||
continue;
|
||||
@ -60,7 +57,6 @@ static void static_nht_update_safi(struct prefix *p, uint32_t nh_num,
|
||||
&& si->type != STATIC_IPV6_GATEWAY_IFNAME)
|
||||
continue;
|
||||
|
||||
orig = si->nh_valid;
|
||||
if (p->family == AF_INET
|
||||
&& p->u.prefix4.s_addr == si->addr.ipv4.s_addr)
|
||||
si->nh_valid = !!nh_num;
|
||||
@ -69,14 +65,7 @@ static void static_nht_update_safi(struct prefix *p, uint32_t nh_num,
|
||||
&& memcmp(&p->u.prefix6, &si->addr.ipv6, 16) == 0)
|
||||
si->nh_valid = !!nh_num;
|
||||
|
||||
if (orig != si->nh_valid)
|
||||
reinstall = true;
|
||||
|
||||
if (reinstall) {
|
||||
static_zebra_route_add(rn, si, vrf->vrf_id,
|
||||
safi, true);
|
||||
reinstall = false;
|
||||
}
|
||||
static_zebra_route_add(rn, si, vrf->vrf_id, safi, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -759,7 +759,7 @@ static void zebra_rnh_eval_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
|
||||
* change.
|
||||
*/
|
||||
zebra_rnh_remove_from_routing_table(rnh);
|
||||
if (!prefix_same(&rnh->resolved_route, prn ? NULL : &prn->p)) {
|
||||
if (!prefix_same(&rnh->resolved_route, prn ? &prn->p : NULL)) {
|
||||
if (prn)
|
||||
prefix_copy(&rnh->resolved_route, &prn->p);
|
||||
else {
|
||||
@ -965,7 +965,6 @@ static void copy_state(struct rnh *rnh, struct route_entry *re,
|
||||
|
||||
static int compare_state(struct route_entry *r1, struct route_entry *r2)
|
||||
{
|
||||
|
||||
if (!r1 && !r2)
|
||||
return 0;
|
||||
|
||||
@ -981,8 +980,7 @@ static int compare_state(struct route_entry *r1, struct route_entry *r2)
|
||||
if (r1->nexthop_num != r2->nexthop_num)
|
||||
return 1;
|
||||
|
||||
if (CHECK_FLAG(r1->status, ROUTE_ENTRY_NEXTHOPS_CHANGED)
|
||||
|| CHECK_FLAG(r1->status, ROUTE_ENTRY_LABELS_CHANGED))
|
||||
if (nexthop_group_hash(&r1->ng) != nexthop_group_hash(&r2->ng))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user