tpws: fc00::/7 private range. PF convert ipv4 to ipv6 mapped address

This commit is contained in:
bol-van
2022-01-23 17:33:37 +03:00
parent 17d161267e
commit 013f3996df
8 changed files with 33 additions and 17 deletions

View File

@@ -165,8 +165,8 @@ bool is_linklocal(const struct sockaddr_in6 *a)
}
bool is_private6(const struct sockaddr_in6* a)
{
// fdf0::/8
return a->sin6_addr.s6_addr[0]==0xFD;
// fc00::/7
return (a->sin6_addr.s6_addr[0] & 0xFE) == 0xFC;
}