summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-03-12 11:05:23 -0500
committermergify-bot <noreply@mergify.com>2022-03-12 19:46:39 +0000
commitbb14bbeab09ef245611dc9b1cbf9e24824605ba8 (patch)
tree298e5f1e9c7272fe3d1eb4f89b8898743c5a62f3
parenta310b24a6d0e3c8a41a8478ccaae11f19c8a2250 (diff)
zebra: prefixlen is not afi/safi dependant in encoding nexthops
When encoding a response to the upper level protocol the prefixlen is not something that needs to be part of the switch statement for handling of a prefix. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit b74f72c1fb7f1c394def38b884b689f1e56eb05b)
-rw-r--r--zebra/zebra_rnh.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 6be00857ca..af2b6a1171 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -1178,13 +1178,12 @@ int zebra_send_rnh_update(struct rnh *rnh, struct zserv *client,
*/
stream_putw(s, rnh->safi);
stream_putw(s, rn->p.family);
+ stream_putc(s, rn->p.prefixlen);
switch (rn->p.family) {
case AF_INET:
- stream_putc(s, rn->p.prefixlen);
stream_put_in_addr(s, &rn->p.u.prefix4);
break;
case AF_INET6:
- stream_putc(s, rn->p.prefixlen);
stream_put(s, &rn->p.u.prefix6, IPV6_MAX_BYTELEN);
break;
default: