From bb14bbeab09ef245611dc9b1cbf9e24824605ba8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 12 Mar 2022 11:05:23 -0500 Subject: [PATCH] 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 (cherry picked from commit b74f72c1fb7f1c394def38b884b689f1e56eb05b) --- zebra/zebra_rnh.c | 3 +-- 1 file changed, 1 insertion(+), 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: -- 2.39.5