Module Name:    src
Committed By:   ozaki-r
Date:           Tue Jan 10 08:45:45 UTC 2017

Modified Files:
        src/sys/net: if.c

Log Message:
Add softnet_lock to if_link_state_change_si

Fix
  panic: lock error: Mutex: mutex_vector_exit: assertion failed:
  MUTEX_OWNER(mtx->mtx_owner) == curthread
at callout_halt <= arp_dad_stop <= in_if_link_down.


To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 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.370 src/sys/net/if.c:1.371
--- src/sys/net/if.c:1.370	Tue Jan 10 05:42:34 2017
+++ src/sys/net/if.c	Tue Jan 10 08:45:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.370 2017/01/10 05:42:34 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.371 2017/01/10 08:45:45 ozaki-r 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.370 2017/01/10 05:42:34 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.371 2017/01/10 08:45:45 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2272,6 +2272,10 @@ if_link_state_change_si(void *arg)
 	int s;
 	uint8_t state;
 
+#ifndef NET_MPSAFE
+	mutex_enter(softnet_lock);
+	KERNEL_LOCK(1, NULL);
+#endif
 	s = splnet();
 
 	/* Pop a link state change from the queue and process it. */
@@ -2283,6 +2287,10 @@ if_link_state_change_si(void *arg)
 		softint_schedule(ifp->if_link_si);
 
 	splx(s);
+#ifndef NET_MPSAFE
+	KERNEL_UNLOCK_ONE(NULL);
+	mutex_exit(softnet_lock);
+#endif
 }
 
 /*

Reply via email to