diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-09-24 16:13:04 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-09-27 12:38:08 -0400 |
| commit | 6cd9a93dddba199e68c73baca62337b704f32e14 (patch) | |
| tree | 89dc6de58cc36c2d364c5fd08d89aa75e0d8267b /zebra/zapi_msg.c | |
| parent | 93f533c3085f75ae1bf6b6b1604cfa211399c364 (diff) | |
zebra: Attempt to clarify variable names as they are used
Cleanup the poorly implemented variable names so that we can
understand what is going on a bit better.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index adf9dfa000..4c0a0c82bf 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1171,7 +1171,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS) struct stream *s; struct prefix p; unsigned short l = 0; - uint8_t flags = 0; + uint8_t connected = 0; uint8_t resolve_via_default; bool exist; bool flag_changed = false; @@ -1189,7 +1189,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS) client->nh_reg_time = monotime(NULL); while (l < hdr->length) { - STREAM_GETC(s, flags); + STREAM_GETC(s, connected); STREAM_GETC(s, resolve_via_default); STREAM_GETW(s, p.family); STREAM_GETC(s, p.prefixlen); @@ -1226,9 +1226,10 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS) return; orig_flags = rnh->flags; - if (flags && !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED)) + if (connected && !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED)) SET_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED); - else if (!flags && CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED)) + else if (!connected + && CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED)) UNSET_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED); if (resolve_via_default) @@ -1265,13 +1266,13 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS) s = msg; while (l < hdr->length) { - uint8_t flags; + uint8_t ignore; - STREAM_GETC(s, flags); - if (flags != 0) + STREAM_GETC(s, ignore); + if (ignore != 0) goto stream_failure; - STREAM_GETC(s, flags); - if (flags != 0) + STREAM_GETC(s, ignore); + if (ignore != 0) goto stream_failure; STREAM_GETW(s, p.family); |
