diff options
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index c4ba2ff1fa2..529e59eb0b9 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.14 2000/02/28 11:55:21 itojun Exp $ */ +/* $OpenBSD: in6.c,v 1.15 2000/03/02 09:44:28 itojun Exp $ */ /* $KAME: in6.c,v 1.55 2000/02/25 00:32:23 itojun Exp $ */ /* @@ -448,11 +448,14 @@ in6_control(so, cmd, data, ifp, p) ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; ia->ia_addr.sin6_family = AF_INET6; ia->ia_addr.sin6_len = sizeof(ia->ia_addr); - ia->ia_ifa.ifa_dstaddr - = (struct sockaddr *)&ia->ia_dstaddr; if (ifp->if_flags & IFF_POINTOPOINT) { + ia->ia_ifa.ifa_dstaddr + = (struct sockaddr *)&ia->ia_dstaddr; ia->ia_dstaddr.sin6_family = AF_INET6; ia->ia_dstaddr.sin6_len = sizeof(ia->ia_dstaddr); + } else { + ia->ia_ifa.ifa_dstaddr = NULL; + bzero(&ia->ia_dstaddr, sizeof(ia->ia_dstaddr)); } ia->ia_ifa.ifa_netmask = (struct sockaddr *)&ia->ia_prefixmask; @@ -1073,6 +1076,9 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p) if ((ifp->if_flags & IFF_POINTOPOINT) != 0) { bcopy(&ia->ia_dstaddr, &ifra.ifra_dstaddr, ia->ia_dstaddr.sin6_len); + } else { + bzero(&ifra.ifra_dstaddr, + sizeof(ifra.ifra_dstaddr)); } bcopy(&ia->ia_prefixmask, &ifra.ifra_dstaddr, ia->ia_prefixmask.sin6_len); |