diff options
author | Jeffrey Hsu <hsu@FreeBSD.org> | 2002-12-18 11:46:59 +0000 |
---|---|---|
committer | Jeffrey Hsu <hsu@FreeBSD.org> | 2002-12-18 11:46:59 +0000 |
commit | 19fc74fb60b2ccd4f1c64f561cde5d0c9835e457 (patch) | |
tree | 079e82ffd683b796c6432b8bcf3ff23f996d4e04 /sys/netatalk | |
parent | 9a26e46eb49463ac5c18ddd8371b4b2b6a6d689b (diff) | |
download | src-19fc74fb60b2ccd4f1c64f561cde5d0c9835e457.tar.gz src-19fc74fb60b2ccd4f1c64f561cde5d0c9835e457.zip |
Lock up ifaddr reference counts.
Notes
Notes:
svn path=/head/; revision=108033
Diffstat (limited to 'sys/netatalk')
-rw-r--r-- | sys/netatalk/at_control.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c index c0e67279802c..d7e7586b648a 100644 --- a/sys/netatalk/at_control.c +++ b/sys/netatalk/at_control.c @@ -159,12 +159,6 @@ at_control(struct socket *so, u_long cmd, caddr_t data, } else { at_ifaddr = aa0; } - /* - * Don't Add a reference for the aa itself! - * I fell into this trap. IFAFREE tests for <=0 - * not <= 1 like RTFREE - */ - /* aa->aa_ifa.ifa_refcnt++; DON'T DO THIS!! */ aa = aa0; /* @@ -172,14 +166,11 @@ at_control(struct socket *so, u_long cmd, caddr_t data, * and link our new one on the end */ ifa = (struct ifaddr *)aa; + IFA_LOCK_INIT(ifa); + ifa->ifa_refcnt = 1; TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); /* - * Add a reference for the linking into the ifp_if_addrlist. - */ - ifa->ifa_refcnt++; - - /* * As the at_ifaddr contains the actual sockaddrs, * and the ifaddr itself, link them al together correctly. */ |