Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net ifnet(9): On if_deactivate, don't make null if_slowt...



details:   https://anonhg.NetBSD.org/src/rev/425278076f96
branches:  trunk
changeset: 369496:425278076f96
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Aug 20 14:05:22 2022 +0000

description:
ifnet(9): On if_deactivate, don't make null if_slowtimo nonnull.

Fixes crash on detach.

diffstat:

 sys/net/if.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 209c5b0c350a -r 425278076f96 sys/net/if.c
--- a/sys/net/if.c      Sat Aug 20 12:42:51 2022 +0000
+++ b/sys/net/if.c      Sat Aug 20 14:05:22 2022 +0000
@@ -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 @@
        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. */



Home | Main Index | Thread Index | Old Index