diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2010-01-13 02:13:13 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2010-01-13 02:13:13 +0000 |
commit | dc2b77c5c209a007b4fbb3168795820a9b050aec (patch) | |
tree | 4f7fae1065dadd3c92ed1c4cbc84f912753db8d9 /sys/netinet | |
parent | 1f237c71d551d40b259d29c58f0b1cbff338af57 (diff) |
instead of fiddling with the per-interface address lists directly in
many places create a proper API (ifa_add / ifa_del) and use it.
ok theo ryan dlg
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 4a73c6cecaa..b3d3fa0f931 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.56 2010/01/13 01:26:28 henning Exp $ */ +/* $OpenBSD: in.c,v 1.57 2010/01/13 02:13:12 henning Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -282,8 +282,6 @@ in_control(so, cmd, data, ifp) ia = malloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO); s = splsoftnet(); TAILQ_INSERT_TAIL(&in_ifaddr, ia, ia_list); - TAILQ_INSERT_TAIL(&ifp->if_addrlist, (struct ifaddr *)ia, - ifa_list); ia->ia_addr.sin_family = AF_INET; ia->ia_addr.sin_len = sizeof(ia->ia_addr); ia->ia_ifa.ifa_addr = sintosa(&ia->ia_addr); @@ -298,6 +296,7 @@ in_control(so, cmd, data, ifp) LIST_INIT(&ia->ia_multiaddrs); if ((ifp->if_flags & IFF_LOOPBACK) == 0) in_interfaces++; + ifa_add(ifp, (struct ifaddr *)ia); splx(s); newifaddr = 1; @@ -450,7 +449,7 @@ cleanup: */ s = splsoftnet(); in_ifscrub(ifp, ia); - TAILQ_REMOVE(&ifp->if_addrlist, (struct ifaddr *)ia, ifa_list); + ifa_del(ifp, (struct ifaddr *)ia); TAILQ_REMOVE(&in_ifaddr, ia, ia_list); if (ia->ia_allhosts != NULL) { in_delmulti(ia->ia_allhosts); |