diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1498,7 +1498,7 @@ { struct linux_ifname_cb_s arg; - IFNET_RLOCK_ASSERT(); + NET_EPOCH_ASSERT(); arg.ifp = ifp; arg.buffer = buffer; @@ -1557,6 +1557,8 @@ static int linprocfs_donetdev(PFS_FILL_ARGS) { + struct epoch_tracker et; + sbuf_printf(sb, "%6s|%58s|%s\n" "%6s|%58s|%58s\n", "Inter-", " Receive", " Transmit", @@ -1565,9 +1567,9 @@ "bytes packets errs drop fifo colls carrier compressed"); CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); if_foreach(linprocfs_donetdev_cb, sb); - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); @@ -1630,15 +1632,16 @@ .sb = sb }; uint32_t fibnum = curthread->td_proc->p_fibnum; + struct epoch_tracker et; sbuf_printf(w.sb, "%-127s\n", "Iface\tDestination\tGateway " "\tFlags\tRefCnt\tUse\tMetric\tMask\t\tMTU" "\tWindow\tIRTT"); CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); rib_walk(fibnum, AF_INET, false, linux_route_print, &w); - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2097,7 +2097,7 @@ linux_ioctl_ifname_cb(if_t ifp, void *arg) { struct linux_ioctl_ifname_cb_s *cbs = arg; - + if (cbs->ifr.ifr_ifindex == cbs->index) { if (!linux_use_real_ifname(ifp)) snprintf(cbs->ifr.ifr_name, LINUX_IFNAMSIZ, @@ -2110,13 +2110,13 @@ if (!linux_use_real_ifname(ifp)) cbs->ethno++; cbs->index++; - return (0); } static int linux_ioctl_ifname(struct thread *td, struct l_ifreq *uifr) { + struct epoch_tracker et; struct linux_ioctl_ifname_cb_s cbs; int error; @@ -2125,18 +2125,16 @@ return (error); CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); cbs.index = 1; /* ifr.ifr_ifindex starts from 1 */ cbs.ethno = 0; error = if_foreach(linux_ioctl_ifname_cb, &cbs); - + NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); if (error == 0) error = ENODEV; - IFNET_RUNLOCK(); if (error == -1) - error = copyout(&cbs.ifr, uifr, sizeof(cbs.ifr)); - CURVNET_RESTORE(); - + error = copyout(&cbs.ifr, uifr, sizeof(ifr)); return (error); } @@ -2230,6 +2228,7 @@ #else struct ifconf ifc; #endif + struct epoch_tracker et; struct linux_ifconfig_ifaddr_cb2_s cbs; struct sbuf *sb; int error, full = 0; @@ -2244,9 +2243,9 @@ /* handle the 'request buffer size' case */ if ((l_uintptr_t)ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); if_foreach(linux_ifconf_ifnet_cb, &ifc); - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); error = copyout(&ifc, uifc, sizeof(ifc)); CURVNET_RESTORE(); return (error); @@ -2270,9 +2269,9 @@ cbs.sb = sb; /* Return all AF_INET addresses of all interfaces */ - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); if_foreach(linux_ifconf_ifnet_cb2, &cbs); - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); if (cbs.valid_len != cbs.max_len && !full) { sbuf_delete(sb);