From c125d1d41ef05cf8bd440a3eab94483c18b9874c Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Sat, 19 Aug 2017 12:09:38 -0300 Subject: babeld/nhrpd: ignore ipv6 srcdest routes Signed-off-by: Renato Westphal --- babeld/babel_zebra.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'babeld') diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c index 37f441c30..a1d3a9e8c 100644 --- a/babeld/babel_zebra.c +++ b/babeld/babel_zebra.c @@ -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); -- cgit v1.2.3