mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 02:30:52 +00:00
zebra: Re-evaluate the nexthop tracking if flags changed
Routing protocols are allowed ( and even encouraged ) to modify the flags that influence the nexthop tracking. As such when we modify the tracking of a nexthop to go from, say, connected force or not we must re-evaluate the nexthop and send the results up to the interested parties. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
9cb8322ed9
commit
906b54ddba
@ -1036,6 +1036,8 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
|
|||||||
uint8_t flags = 0;
|
uint8_t flags = 0;
|
||||||
uint16_t type = cmd2type[hdr->command];
|
uint16_t type = cmd2type[hdr->command];
|
||||||
bool exist;
|
bool exist;
|
||||||
|
bool flag_changed = false;
|
||||||
|
uint8_t orig_flags;
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_NHT)
|
if (IS_ZEBRA_DEBUG_NHT)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
@ -1084,6 +1086,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
|
|||||||
if (!rnh)
|
if (!rnh)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
orig_flags = rnh->flags;
|
||||||
if (type == RNH_NEXTHOP_TYPE) {
|
if (type == RNH_NEXTHOP_TYPE) {
|
||||||
if (flags
|
if (flags
|
||||||
&& !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
|
&& !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
|
||||||
@ -1101,9 +1104,12 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
|
|||||||
UNSET_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH);
|
UNSET_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (orig_flags != rnh->flags)
|
||||||
|
flag_changed = true;
|
||||||
|
|
||||||
zebra_add_rnh_client(rnh, client, type, zvrf_id(zvrf));
|
zebra_add_rnh_client(rnh, client, type, zvrf_id(zvrf));
|
||||||
/* Anything not AF_INET/INET6 has been filtered out above */
|
/* Anything not AF_INET/INET6 has been filtered out above */
|
||||||
if (!exist)
|
if (!exist || flag_changed)
|
||||||
zebra_evaluate_rnh(zvrf, family2afi(p.family), 1, type,
|
zebra_evaluate_rnh(zvrf, family2afi(p.family), 1, type,
|
||||||
&p);
|
&p);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user