summaryrefslogtreecommitdiff
path: root/lib/prefix.c
diff options
context:
space:
mode:
authorDavid Schweizer <dschweizer@opensourcerouting.org>2025-02-12 13:07:38 +0100
committerDavid Schweizer <dschweizer@opensourcerouting.org>2025-02-14 15:05:08 +0100
commit1eef3a77e32b711311551a699b475317f8f9729a (patch)
tree36532f0c508bc456626c8f108e9dba79a38e84d2 /lib/prefix.c
parent196b7f1c313f2e0d66a1172b7913822825487ca5 (diff)
lib,zebra: Allow class E prefixes in RIB
Changes allow ipv4 class E addresses and prefixes in the 240.0.0.0/4 range to be configured on interfaces, imported from the kernel routing table and redistributed as connected routes in zebra by default. Changes also fix routes with class E prefixes in kernel routing table getting rejected by zebra during early daemon startup. Drivin this change in default behavior are cloud providers (with customers still using obsolete ipv4 protocol, i.e. Azure, AWS) running out of ip space and abusing class E for addressing instances (announced via BGP) over tunneling connections back to customers on premise infrastructure. Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
Diffstat (limited to 'lib/prefix.c')
-rw-r--r--lib/prefix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/prefix.c b/lib/prefix.c
index 2485c3e61b..feaf3e5f1c 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -1439,10 +1439,13 @@ bool ipv4_unicast_valid(const struct in_addr *addr)
{
in_addr_t ip = ntohl(addr->s_addr);
+ if (IPV4_CLASS_E(ip))
+ return true;
+
if (IPV4_CLASS_D(ip))
return false;
- if (IPV4_NET0(ip) || IPV4_NET127(ip) || IPV4_CLASS_E(ip)) {
+ if (IPV4_NET0(ip) || IPV4_NET127(ip)) {
if (cmd_allow_reserved_ranges_get())
return true;
else