diff options
author | 2015-09-01 21:24:04 +0000 | |
---|---|---|
committer | 2015-09-01 21:24:04 +0000 | |
commit | 3e30338388d81a08b66f02cbc9e72adfbe91bdbe (patch) | |
tree | 7cd988f0e0c2a497841c45734e676b80cf484520 /sys/net/if_tun.c | |
parent | Remove all bogus writes to stderr. Only explicit requests should (diff) | |
download | wireguard-openbsd-3e30338388d81a08b66f02cbc9e72adfbe91bdbe.tar.xz wireguard-openbsd-3e30338388d81a08b66f02cbc9e72adfbe91bdbe.zip |
Replace sockaddr casts with the proper satosin(), ... calls.
From David Hill; OK mpi@; tested kspillner@; tweaks bluhm@
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 31cfdb929db..d0fc0936efa 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.152 2015/08/28 15:37:04 reyk Exp $ */ +/* $OpenBSD: if_tun.c,v 1.153 2015/09/01 21:24:04 bluhm Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -444,16 +444,16 @@ tuninit(struct tun_softc *tp) } #ifdef INET6 if (ifa->ifa_addr->sa_family == AF_INET6) { - struct sockaddr_in6 *sin; + struct sockaddr_in6 *sin6; - sin = (struct sockaddr_in6 *)ifa->ifa_addr; - if (!IN6_IS_ADDR_UNSPECIFIED(&sin->sin6_addr)) + sin6 = satosin6(ifa->ifa_addr); + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) tp->tun_flags |= TUN_IASET; if (ifp->if_flags & IFF_POINTOPOINT) { - sin = (struct sockaddr_in6 *)ifa->ifa_dstaddr; - if (sin && - !IN6_IS_ADDR_UNSPECIFIED(&sin->sin6_addr)) + sin6 = satosin6(ifa->ifa_dstaddr); + if (sin6 && + !IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) tp->tun_flags |= TUN_DSTADDR; } else tp->tun_flags &= ~TUN_DSTADDR; |