First fill in structure with valid values, and only then attach it

to the global list.

Reviewed by:	rwatson
This commit is contained in:
Gleb Smirnoff 2005-10-28 20:29:42 +00:00
parent a65a0da2f9
commit f3d30eb20d

View File

@ -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;
}