Module Name:    src
Committed By:   yamaguchi
Date:           Mon Oct 16 08:25:57 UTC 2023

Modified Files:
        src/sys/net/lagg: if_lagg.c

Log Message:
Fix missing IFNET_LOCK holding while destroy the lagg interface


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/net/lagg/if_lagg.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/lagg/if_lagg.c
diff -u src/sys/net/lagg/if_lagg.c:1.49 src/sys/net/lagg/if_lagg.c:1.50
--- src/sys/net/lagg/if_lagg.c:1.49	Mon Oct 16 07:49:01 2023
+++ src/sys/net/lagg/if_lagg.c	Mon Oct 16 08:25:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_lagg.c,v 1.49 2023/10/16 07:49:01 yamaguchi Exp $	*/
+/*	$NetBSD: if_lagg.c,v 1.50 2023/10/16 08:25:57 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006 Reyk Floeter <r...@openbsd.org>
@@ -20,7 +20,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.49 2023/10/16 07:49:01 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.50 2023/10/16 08:25:57 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -444,11 +444,13 @@ lagg_clone_destroy(struct ifnet *ifp)
 
 	lagg_stop(ifp, 1);
 
+	IFNET_LOCK(ifp);
 	LAGG_LOCK(sc);
 	while ((lp = LAGG_PORTS_FIRST(sc)) != NULL) {
 		lagg_port_teardown(sc, lp, false);
 	}
 	LAGG_UNLOCK(sc);
+	IFNET_UNLOCK(ifp);
 
 	switch (ifp->if_type) {
 	case IFT_ETHER:

Reply via email to