Skip to content

Commit

Permalink
zebra: prefixlen is not afi/safi dependant in encoding nexthops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
donaldsharp committed Mar 12, 2022
1 parent 06e4e90 commit b74f72c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zebra/zebra_rnh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,13 +1174,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:
Expand Down

0 comments on commit b74f72c

Please sign in to comment.