if_ovpn: deal with v4 mapped IPv6 addresses
Openvpn defaults to binding to IPv6 sockets (with setsockopt(IPV6_V6ONLY=0)), which we didn't deal with. That resulted in us trying to in6_selectsrc_addr() on a v4 mapped v6 address, which does not work. Instead we translate the mapped address to v4 and treat it as an IPv4 address. Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
parent
711d50bd9e
commit
9f7c81eb33
@ -531,6 +531,13 @@ ovpn_new_peer(struct ifnet *ifp, const nvlist_t *nvl)
|
||||
free(name, M_SONAME);
|
||||
name = NULL;
|
||||
|
||||
if (peer->local.ss_family == AF_INET6 &&
|
||||
IN6_IS_ADDR_V4MAPPED(&TO_IN6(&peer->remote)->sin6_addr)) {
|
||||
/* V4 mapped address, so treat this as v4, not v6. */
|
||||
in6_sin6_2_sin_in_sock((struct sockaddr *)&peer->local);
|
||||
in6_sin6_2_sin_in_sock((struct sockaddr *)&peer->remote);
|
||||
}
|
||||
|
||||
#ifdef INET6
|
||||
if (peer->local.ss_family == AF_INET6 &&
|
||||
IN6_IS_ADDR_UNSPECIFIED(&TO_IN6(&peer->local)->sin6_addr)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user