babeld/nhrpd: ignore ipv6 srcdest routes

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2017-08-19 12:09:38 -03:00
parent 34b054ba6d
commit c125d1d41e
2 changed files with 23 additions and 1 deletions

View File

@ -63,7 +63,7 @@ babel_zebra_read_ipv6 (int command, struct zclient *zclient,
struct zapi_ipv6 api;
unsigned long ifindex = -1;
struct in6_addr nexthop;
struct prefix_ipv6 prefix;
struct prefix_ipv6 prefix, src_p;
s = zclient->ibuf;
ifindex = 0;
@ -82,6 +82,16 @@ babel_zebra_read_ipv6 (int command, struct zclient *zclient,
prefix.prefixlen = stream_getc (s);
stream_get (&prefix.prefix, s, PSIZE (prefix.prefixlen));
memset(&src_p, 0, sizeof(src_p));
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) {
src_p.family = AF_INET6;
src_p.prefixlen = stream_getc(s);
stream_get(&src_p.prefix, s, PSIZE(src_p.prefixlen));
}
if (src_p.prefixlen)
/* we completely ignore srcdest routes for now. */
return 0;
/* Nexthop, ifindex, distance, metric. */
if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) {
api.nexthop_num = stream_getc (s);

View File

@ -193,6 +193,7 @@ int nhrp_route_read(int cmd, struct zclient *zclient, zebra_size_t length, vrf_i
struct stream *s;
struct interface *ifp = NULL;
struct prefix prefix;
struct prefix_ipv6 src_p;
union sockunion nexthop_addr;
unsigned char message, nexthop_num, ifindex_num;
unsigned ifindex;
@ -226,6 +227,17 @@ int nhrp_route_read(int cmd, struct zclient *zclient, zebra_size_t length, vrf_i
prefix.prefixlen = stream_getc(s);
stream_get(&prefix.u.val, s, PSIZE(prefix.prefixlen));
memset(&src_p, 0, sizeof(src_p));
if (prefix.family == AF_INET6 &&
CHECK_FLAG(message, ZAPI_MESSAGE_SRCPFX)) {
src_p.family = AF_INET6;
src_p.prefixlen = stream_getc(s);
stream_get(&src_p.prefix, s, PSIZE(src_p.prefixlen));
}
if (src_p.prefixlen)
/* we completely ignore srcdest routes for now. */
return 0;
/* Nexthop, ifindex, distance, metric. */
if (CHECK_FLAG(message, ZAPI_MESSAGE_NEXTHOP|ZAPI_MESSAGE_IFINDEX)) {
nexthop_num = stream_getc(s);