Module Name: src
Committed By: riastradh
Date: Sat Aug 20 14:05:22 UTC 2022
Modified Files:
src/sys/net: if.c
Log Message:
ifnet(9): On if_deactivate, don't make null if_slowtimo nonnull.
Fixes crash on detach.
To generate a diff of this commit:
cvs rdiff -u -r1.515 -r1.516 src/sys/net/if.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.515 src/sys/net/if.c:1.516
--- src/sys/net/if.c:1.515 Sat Aug 20 12:42:51 2022
+++ src/sys/net/if.c Sat Aug 20 14:05:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.515 2022/08/20 12:42:51 riastradh Exp $ */
+/* $NetBSD: if.c,v 1.516 2022/08/20 14:05:22 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.515 2022/08/20 12:42:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.516 2022/08/20 14:05:22 riastradh Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -1223,7 +1223,8 @@ if_deactivate(struct ifnet *ifp)
ifp->if_ioctl = if_nullioctl;
ifp->if_init = if_nullinit;
ifp->if_stop = if_nullstop;
- ifp->if_slowtimo = if_nullslowtimo;
+ if (ifp->if_slowtimo)
+ ifp->if_slowtimo = if_nullslowtimo;
ifp->if_drain = if_nulldrain;
/* No more packets may be enqueued. */