zebra: Cleanup nexthop update encoding

The encoding of the nexthop update made some distinctions
between nexthop types that it does not need to.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-02-05 03:42:09 -05:00
parent 65e630c051
commit aab09c104e

View file

@ -1034,6 +1034,7 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
stream_putc(s, nexthop->type);
switch (nexthop->type) {
case NEXTHOP_TYPE_IPV4:
case NEXTHOP_TYPE_IPV4_IFINDEX:
stream_put_in_addr(s,
&nexthop->gate.ipv4);
stream_putl(s, nexthop->ifindex);
@ -1041,15 +1042,7 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
case NEXTHOP_TYPE_IFINDEX:
stream_putl(s, nexthop->ifindex);
break;
case NEXTHOP_TYPE_IPV4_IFINDEX:
stream_put_in_addr(s,
&nexthop->gate.ipv4);
stream_putl(s, nexthop->ifindex);
break;
case NEXTHOP_TYPE_IPV6:
stream_put(s, &nexthop->gate.ipv6, 16);
stream_putl(s, nexthop->ifindex);
break;
case NEXTHOP_TYPE_IPV6_IFINDEX:
stream_put(s, &nexthop->gate.ipv6, 16);
stream_putl(s, nexthop->ifindex);