[PATCH] bird: treat former classe addresses as valid addresses
There is no reason to disallow the former class e address space, except in a bogon file. --- lib/ip.c | 8 ++++++-- lib/ip.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ip.c b/lib/ip.c index 2050d19e..022c7d74 100644 --- a/lib/ip.c +++ b/lib/ip.c @@ -100,8 +100,12 @@ ip4_classify(ip4_addr ad) if (b >= 0xe0 && b <= 0xef) return IADDR_MULTICAST | SCOPE_UNIVERSE; - if (a == 0xffffffff) - return IADDR_BROADCAST | SCOPE_LINK; + if (b >= 0xf0) + if(a == 0xffffffff) { + return IADDR_BROADCAST | SCOPE_LINK; + } else { + return IADDR_HOST | SCOPE_UNIVERSE; + } return IADDR_INVALID; } diff --git a/lib/ip.h b/lib/ip.h index 4fbe4407..2d1b4cff 100644 --- a/lib/ip.h +++ b/lib/ip.h @@ -312,7 +312,7 @@ static inline int ip6_is_v4mapped(ip6_addr a) #endif static inline int ip4_is_unicast(ip4_addr a) -{ return _I(a) < 0xe0000000; } +{ return _I(a) < 0xe0000000 || (_I(a) >= 0xf0000000 && _I(a) != 0xffffffff); } static inline int ipa_classify_net(ip_addr a) { return ipa_zero2(a) ? (IADDR_HOST | SCOPE_UNIVERSE) : ipa_classify(a); } -- 2.17.1
On Tue, Dec 11, 2018 at 03:26:08PM -0800, Dave Taht wrote:
There is no reason to disallow the former class e address space, except in a bogon file.
Hi
static inline int ip4_is_unicast(ip4_addr a) -{ return _I(a) < 0xe0000000; } +{ return _I(a) < 0xe0000000 || (_I(a) >= 0xf0000000 && _I(a) != 0xffffffff); }
Well, this summarises the reason why to disallow former class E address space. If these addresses are not defined / reserved for future use, how can we say that they are unicast and not multicast or for some complete different but not yet defined purpose? IMHO first should IETF redefine it as a regular unicast range, then routing software should change its behavior. Please correct me if that already happened. OTOH, perhaps we could allow all possible routes regardless of address classification (even for prefixes from multicast range) in routing table. OSes allow that and sometimes even uses that (e.g. route for multicast range in regular unicast table is used for selection of default multcast interface on clients). -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Dave Taht -
Ondrej Zajicek