summaryrefslogtreecommitdiffstats
path: root/ripngd/ripng_zebra.c
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2015-07-08 19:48:51 +0200
committerChristian Franke <chris@opensourcerouting.org>2017-01-30 13:47:04 +0100
commit81a164e2d9919ac3a7842d5b90cd8b1dfc2a1e9a (patch)
treec98f21af8e2913805ade65b663f010d47b6c984a /ripngd/ripng_zebra.c
parentlib: send ZAPI IPv6 source prefix (diff)
downloadfrr-81a164e2d9919ac3a7842d5b90cd8b1dfc2a1e9a.tar.xz
frr-81a164e2d9919ac3a7842d5b90cd8b1dfc2a1e9a.zip
*: read and ignore srcdest routes on ZAPI
Since zebra might be sending srcdest routes down to the various daemons, they need to understand the presence of the field at the very least. Sadly, that's also the best we can do at this point since none of the protocols has support for handling srcdest routes. The only consistent thing to do is to ignore them throughout. If an administrator wants to have the srcdest route as non-srcdest in a protocol, setting a non-srcdest static route (possibly blackhole) is probably the best way to go. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ripngd/ripng_zebra.c')
-rw-r--r--ripngd/ripng_zebra.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index 970aa14df..964af81d1 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -140,7 +140,7 @@ ripng_zebra_read_ipv6 (int command, struct zclient *zclient,
struct zapi_ipv6 api;
unsigned long ifindex;
struct in6_addr nexthop;
- struct prefix_ipv6 p;
+ struct prefix_ipv6 p, src_p;
s = zclient->ibuf;
ifindex = 0;
@@ -158,6 +158,18 @@ ripng_zebra_read_ipv6 (int command, struct zclient *zclient,
p.prefixlen = MIN(IPV6_MAX_PREFIXLEN, stream_getc (s));
stream_get (&p.prefix, s, PSIZE (p.prefixlen));
+ memset (&src_p, 0, sizeof (struct prefix_ipv6));
+ src_p.family = AF_INET6;
+ if (CHECK_FLAG (api.message, ZAPI_MESSAGE_SRCPFX))
+ {
+ 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))
{