mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 04:40:21 +00:00
Merge pull request #5192 from donaldsharp/zebra_rejection
zebra: Dissallow a /32 or /128 through itself
This commit is contained in:
commit
d79368d3a5
@ -1354,6 +1354,17 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
|
||||
}
|
||||
}
|
||||
|
||||
if ((top->p.family == AF_INET && top->p.prefixlen == 32
|
||||
&& nexthop->gate.ipv4.s_addr == top->p.u.prefix4.s_addr)
|
||||
|| (top->p.family == AF_INET6 && top->p.prefixlen == 128
|
||||
&& memcmp(&nexthop->gate.ipv6, &top->p.u.prefix6, 16) == 0)) {
|
||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
|
||||
zlog_debug(
|
||||
"\t:%s: Attempting to install a max prefixlength route through itself",
|
||||
__PRETTY_FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Make lookup prefix. */
|
||||
memset(&p, 0, sizeof(struct prefix));
|
||||
switch (afi) {
|
||||
|
Loading…
Reference in New Issue
Block a user