diff options
author | Christian Franke <chris@opensourcerouting.org> | 2015-07-08 19:48:51 +0200 |
---|---|---|
committer | Christian Franke <chris@opensourcerouting.org> | 2017-01-30 13:47:04 +0100 |
commit | 81a164e2d9919ac3a7842d5b90cd8b1dfc2a1e9a (patch) | |
tree | c98f21af8e2913805ade65b663f010d47b6c984a /ospf6d/ospf6_zebra.c | |
parent | lib: send ZAPI IPv6 source prefix (diff) | |
download | frr-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 'ospf6d/ospf6_zebra.c')
-rw-r--r-- | ospf6d/ospf6_zebra.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index c20311e92..76bee9cf5 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -217,7 +217,7 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, struct stream *s; struct zapi_ipv6 api; unsigned long ifindex; - struct prefix_ipv6 p; + struct prefix_ipv6 p, src_p; struct in6_addr *nexthop; if (ospf6 == NULL) @@ -240,6 +240,18 @@ ospf6_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)) { |