diff options
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 440de3635f..92662fd70f 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 @@ -1628,6 +1636,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); |
