-/* $OpenBSD: if.c,v 1.714 2023/12/29 11:43:04 bluhm Exp $ */
+/* $OpenBSD: if.c,v 1.715 2024/01/06 10:58:45 bluhm Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
unsigned int ifidx = (unsigned long)xifidx;
struct ifnet *ifp;
- KERNEL_LOCK();
NET_LOCK();
+ KERNEL_LOCK();
ifp = if_get(ifidx);
if (ifp != NULL)
if_linkstate(ifp);
if_put(ifp);
- NET_UNLOCK();
KERNEL_UNLOCK();
+ NET_UNLOCK();
}
void
-/* $OpenBSD: in.c,v 1.185 2023/06/28 11:49:49 kn Exp $ */
+/* $OpenBSD: in.c,v 1.186 2024/01/06 10:58:45 bluhm Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
return (error);
}
- KERNEL_LOCK();
NET_LOCK();
+ KERNEL_LOCK();
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family != AF_INET)
break;
}
err:
- NET_UNLOCK();
KERNEL_UNLOCK();
+ NET_UNLOCK();
return (error);
}
if (error)
return (error);
- KERNEL_LOCK();
NET_LOCK();
+ KERNEL_LOCK();
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family != AF_INET)
if (!error)
if_addrhooks_run(ifp);
- NET_UNLOCK();
KERNEL_UNLOCK();
+ NET_UNLOCK();
return error;
}
return (error);
}
- KERNEL_LOCK();
NET_LOCK();
+ KERNEL_LOCK();
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family != AF_INET)
panic("%s: invalid ioctl %lu", __func__, cmd);
}
- NET_UNLOCK();
KERNEL_UNLOCK();
+ NET_UNLOCK();
return (error);
}