Skip to content

Commit

Permalink
Merge pull request #5286 from ton31337/fix/re-evaluate_nexthop_if_fla…
Browse files Browse the repository at this point in the history
…gs_changed_7.0

zebra: [7.0] Re-evaluate the nexthop tracking if flags changed
  • Loading branch information
donaldsharp committed Nov 6, 2019
2 parents 97cb87c + 5eb3bf5 commit 0fe3ee0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion zebra/zapi_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,8 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
uint8_t flags = 0;
uint16_t type = cmd2type[hdr->command];
bool exist;
bool flag_changed = false;
uint8_t orig_flags;

if (IS_ZEBRA_DEBUG_NHT)
zlog_debug(
Expand Down Expand Up @@ -1087,6 +1089,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
if (!rnh)
return;

orig_flags = rnh->flags;
if (type == RNH_NEXTHOP_TYPE) {
if (flags
&& !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
Expand All @@ -1104,9 +1107,12 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
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));
/* Anything not AF_INET/INET6 has been filtered out above */
if (!exist)
if (!exist || flag_changed)
zebra_evaluate_rnh(zvrf, p.family, 1, type, &p);
}

Expand Down

0 comments on commit 0fe3ee0

Please sign in to comment.