On Fri, 11 Dec 2015, Donald Sharp wrote:

Block martian address configuration on an interface and also block from getting installed into the zebra tables.

Idea behind the fix was to not allow martian address configurations in quagga and also block any connected martian address installation coming from kernel

---
lib/prefix.h      | 15 ++++++++++++++-
zebra/connected.c |  6 ++++++
zebra/interface.c | 12 ++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/lib/prefix.h b/lib/prefix.h
index a517d79..779c68e 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -234,13 +234,26 @@ extern void masklen2ip6 (const int, struct in6_addr *);
extern void str2in6_addr (const char *, struct in6_addr *);
extern const char *inet6_ntoa (struct in6_addr);

+static inline int ipv6_martian (struct in6_addr *addr)
+{
+  struct in6_addr localhost_addr;
+
+  inet_pton (AF_INET6, "::1", &localhost_addr);

So every invocation has to do inet_pton??

+
+  if (IPV6_ADDR_SAME(&localhost_addr, addr))
+    return 1;
+
+  return 0;
+}
+
#endif /* HAVE_IPV6 */


(Note, this is re-transmit of this comment).

regards,
--
Paul Jakma | p...@jakma.org | @pjakma | Key ID: 0xD86BF79464A2FF6A
Fortune:
Turn right here. No! NO! The OTHER right!

_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to