diff options
author | hsu <hsu@FreeBSD.org> | 2002-12-18 11:46:59 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2002-12-18 11:46:59 +0000 |
commit | c3153934cb24d911042c92eedf9e5dd6d7be07e1 (patch) | |
tree | 079e82ffd683b796c6432b8bcf3ff23f996d4e04 /sys/netinet6 | |
parent | 2d0e93bb2eab2533104a92a432361a0d75aae7da (diff) | |
download | FreeBSD-src-c3153934cb24d911042c92eedf9e5dd6d7be07e1.zip FreeBSD-src-c3153934cb24d911042c92eedf9e5dd6d7be07e1.tar.gz |
Lock up ifaddr reference counts.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index f0e7b40..bb38bde 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -908,6 +908,7 @@ in6_update_ifa(ifp, ifra, ia) return (ENOBUFS); bzero((caddr_t)ia, sizeof(*ia)); /* Initialize the address and masks */ + IFA_LOCK_INIT(&ia->ia_ifa); 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); @@ -921,8 +922,7 @@ in6_update_ifa(ifp, ifra, ia) } else { ia->ia_ifa.ifa_dstaddr = NULL; } - ia->ia_ifa.ifa_netmask - = (struct sockaddr *)&ia->ia_prefixmask; + ia->ia_ifa.ifa_netmask = (struct sockaddr *)&ia->ia_prefixmask; ia->ia_ifp = ifp; if ((oia = in6_ifaddr) != NULL) { @@ -932,8 +932,8 @@ in6_update_ifa(ifp, ifra, ia) } else in6_ifaddr = ia; - TAILQ_INSERT_TAIL(&ifp->if_addrlist, &ia->ia_ifa, - ifa_list); + ia->ia_ifa.ifa_refcnt = 1; + TAILQ_INSERT_TAIL(&ifp->if_addrlist, &ia->ia_ifa, ifa_list); } /* set prefix mask */ |