diff options
author | glebius <glebius@FreeBSD.org> | 2005-10-28 20:29:42 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-10-28 20:29:42 +0000 |
commit | ed194f4ef3895988a45b4ebb290dfd56efacfd2b (patch) | |
tree | f35233800dd5656b9b836cf8dc184b231f5b4978 /sys | |
parent | 38ae497c6a8e6bd976ae5ade45c3c5a7501098fb (diff) | |
download | FreeBSD-src-ed194f4ef3895988a45b4ebb290dfd56efacfd2b.zip FreeBSD-src-ed194f4ef3895988a45b4ebb290dfd56efacfd2b.tar.gz |
First fill in structure with valid values, and only then attach it
to the global list.
Reviewed by: rwatson
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/in.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 4d902ea..7c92dd3 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -307,8 +307,6 @@ in_control(so, cmd, data, ifp, td) * while we're modifying it. */ s = splnet(); - TAILQ_INSERT_TAIL(&in_ifaddrhead, ia, ia_link); - ifa = &ia->ia_ifa; IFA_LOCK_INIT(ifa); ifa->ifa_addr = (struct sockaddr *)&ia->ia_addr; @@ -324,6 +322,8 @@ in_control(so, cmd, data, ifp, td) ia->ia_broadaddr.sin_family = AF_INET; } ia->ia_ifp = ifp; + + TAILQ_INSERT_TAIL(&in_ifaddrhead, ia, ia_link); splx(s); iaIsNew = 1; } |