From: bluhm Date: Sat, 23 Aug 2014 18:32:55 +0000 (+0000) Subject: Move splnet() in in_ifinit() to protect less code that does not X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=80ec14452f32dda4a42a91c4a5462c2d4ccc2ce0;p=openbsd Move splnet() in in_ifinit() to protect less code that does not need it. OK mpi@ --- diff --git a/sys/netinet/in.c b/sys/netinet/in.c index acfa84755d9..747613c4d49 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.101 2014/07/12 18:44:23 tedu Exp $ */ +/* $OpenBSD: in.c,v 1.102 2014/08/23 18:32:55 bluhm Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -610,7 +610,9 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, { u_int32_t i = sin->sin_addr.s_addr; struct sockaddr_in oldaddr; - int s = splnet(), error = 0; + int s, error = 0; + + splsoftassert(IPL_SOFTNET); if (newaddr) TAILQ_INSERT_TAIL(&in_ifaddr, ia, ia_list); @@ -623,6 +625,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, rt_ifa_delloop(&ia->ia_ifa); ifa_del(ifp, &ia->ia_ifa); } + s = splnet(); oldaddr = ia->ia_addr; ia->ia_addr = *sin; @@ -639,14 +642,6 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, } splx(s); - /* - * How should a packet be routed during - * an address change--and is it safe? - * Is the "ifp" even in a consistent state? - * Be safe for now. - */ - splsoftassert(IPL_SOFTNET); - if (ia->ia_netmask == 0) { if (IN_CLASSA(i)) ia->ia_netmask = IN_CLASSA_NET;