[Babel-users] [PATCH] Relax martians check

Dave Taht dave.taht at gmail.com
Tue Dec 11 20:50:18 GMT 2018


From: Dave Taht <dave at taht.net>

Other routing daemons use a bogon list to manage invalid IP
addresses. Babel's martians check was too restrictive.

This patch enables both class-e and multicast IP addresses to be
carried within the babel protocol.
---
 util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util.c b/util.c
index 38b834f..6c1ba8c 100644
--- a/util.c
+++ b/util.c
@@ -446,7 +446,8 @@ martian_prefix(const unsigned char *prefix, int plen)
          (prefix[15] == 0 || prefix[15] == 1)) ||
         (plen >= 96 && v4mapped(prefix) &&
          ((plen >= 104 && (prefix[12] == 127 || prefix[12] == 0)) ||
-          (plen >= 100 && (prefix[12] & 0xE0) == 0xE0)));
+          (plen >= 128 && (prefix[12] == 0xFF) && (prefix[13] == 0xFF) &&
+	   (prefix[14] == 0xFF) && (prefix[15] == 0xFF))));
 }
 
 int
-- 
2.17.1




More information about the Babel-users mailing list