diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-08-20 15:11:27 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-08-20 15:11:27 +0000 |
| commit | aef8a9f43ca08824b2a33bccd00c3f6a573bb312 (patch) | |
| tree | 6c6ee97139a4ce2de3bd270dee01327e781fcc8a /sys/net | |
| parent | a23b5617518499d2a70d160de642c41d485919f5 (diff) | |
ifnet(9): Make sure to use if_timer and if_watchdog at IPL_NET.
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/if.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 664f3bd3b2d..6126404ed9a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.516 2022/08/20 14:05:22 riastradh Exp $ */ +/* $NetBSD: if.c,v 1.517 2022/08/20 15:11:27 riastradh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.516 2022/08/20 14:05:22 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.517 2022/08/20 15:11:27 riastradh Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -2691,11 +2691,14 @@ static bool if_slowtimo_countdown(struct ifnet *ifp) { bool fire = false; + int s; - KERNEL_LOCK(1, NULL); /* for ifp->ifp_timer */ + s = splnet(); + KERNEL_LOCK(1, NULL); if (ifp->if_timer != 0 && --ifp->if_timer == 0) fire = true; KERNEL_UNLOCK_ONE(NULL); + splx(s); return fire; } @@ -2727,10 +2730,13 @@ if_slowtimo_work(struct work *work, void *arg) struct if_slowtimo_data *isd = container_of(work, struct if_slowtimo_data, isd_work); struct ifnet *ifp = isd->isd_ifp; + int s; + s = splnet(); KERNEL_LOCK(1, NULL); (*ifp->if_slowtimo)(ifp); KERNEL_UNLOCK_ONE(NULL); + splx(s); mutex_enter(&isd->isd_lock); if (isd->isd_trigger) { |
