diff options
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 440de3635f..cea4b098fc 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -786,7 +786,6 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p, return zclient_send_message(zclient); } -#ifdef HAVE_IPV6 int zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p, struct zapi_ipv6 *api) @@ -855,12 +854,15 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient, int zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p, - struct zapi_ipv6 *api) + struct prefix_ipv6 *src_p, struct zapi_ipv6 *api) { int i; int psize; struct stream *s; + /* either we have !SRCPFX && src_p == NULL, or SRCPFX && src_p != NULL */ + assert (!(api->message & ZAPI_MESSAGE_SRCPFX) == !src_p); + /* Reset stream. */ s = zclient->obuf; stream_reset (s); @@ -879,6 +881,13 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p, stream_putc (s, p->prefixlen); stream_write (s, (u_char *)&p->prefix, psize); + if (CHECK_FLAG (api->message, ZAPI_MESSAGE_SRCPFX)) + { + psize = PSIZE (src_p->prefixlen); + stream_putc (s, src_p->prefixlen); + stream_write (s, (u_char *)&src_p->prefix, psize); + } + /* Nexthop, ifindex, distance and metric information. */ if (CHECK_FLAG (api->message, ZAPI_MESSAGE_NEXTHOP)) { @@ -918,7 +927,6 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p, return zclient_send_message(zclient); } -#endif /* HAVE_IPV6 */ /* * send a ZEBRA_REDISTRIBUTE_ADD or ZEBRA_REDISTRIBUTE_DELETE @@ -1138,11 +1146,15 @@ struct interface * zebra_interface_link_params_read (struct stream *s) { struct if_link_params *iflp; - uint32_t ifindex = stream_getl (s); + ifindex_t ifindex; + + assert (s); + + ifindex = stream_getl (s); struct interface *ifp = if_lookup_by_index (ifindex); - if (ifp == NULL || s == NULL) + if (ifp == NULL) { zlog_err ("%s: unknown ifindex %u, shouldn't happen", __func__, ifindex); @@ -1628,6 +1640,7 @@ zclient_read (struct thread *thread) case ZEBRA_REDISTRIBUTE_IPV6_DEL: if (zclient->redistribute_route_ipv6_del) (*zclient->redistribute_route_ipv6_del) (command, zclient, length, vrf_id); + break; case ZEBRA_INTERFACE_LINK_PARAMS: if (zclient->interface_link_params) (*zclient->interface_link_params) (command, zclient, length); |
