diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/zclient.c | 12 | ||||
| -rw-r--r-- | lib/zclient.h | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 42fa41c9c8..92662fd70f 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -854,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); @@ -878,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)) { diff --git a/lib/zclient.h b/lib/zclient.h index 7808fd804f..6b1a18a311 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -246,7 +246,8 @@ struct zapi_ipv6 }; extern int zapi_ipv6_route (u_char cmd, struct zclient *zclient, - struct prefix_ipv6 *p, struct zapi_ipv6 *api); + struct prefix_ipv6 *p, struct prefix_ipv6 *src_p, + struct zapi_ipv6 *api); extern int zapi_ipv4_route_ipv6_nexthop (u_char, struct zclient *, struct prefix_ipv4 *, struct zapi_ipv6 *); |
