In BSD network code, don't add a route that's a subset of an Address
This commit is contained in:
parent
57642ca653
commit
4b9fa05b5c
1 changed files with 7 additions and 0 deletions
|
@ -503,6 +503,13 @@ bool TunsafeBackendBsd::Configure(const TunConfig &&config, TunConfigOut *out) o
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On linux, don't add a route that equals one of the addresses
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
if (IsWgCidrAddrSubsetOfAny(*it, config.addresses))
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (it->size == 32) {
|
if (it->size == 32) {
|
||||||
AddRoute(ReadBE32(it->addr), it->cidr, ipv4_ip, devname_);
|
AddRoute(ReadBE32(it->addr), it->cidr, ipv4_ip, devname_);
|
||||||
} else if (it->size == 128 && ipv6_addr) {
|
} else if (it->size == 128 && ipv6_addr) {
|
||||||
|
|
Loading…
Reference in a new issue