Module Name:    src
Committed By:   yamaguchi
Date:           Fri Apr  5 06:07:37 UTC 2024

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

Log Message:
lagg(4): added missing pserialize_read_enter


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/net/lagg/if_lagg_lacp.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_lacp.c
diff -u src/sys/net/lagg/if_lagg_lacp.c:1.37 src/sys/net/lagg/if_lagg_lacp.c:1.38
--- src/sys/net/lagg/if_lagg_lacp.c:1.37	Thu Apr  4 09:19:42 2024
+++ src/sys/net/lagg/if_lagg_lacp.c	Fri Apr  5 06:07:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_lagg_lacp.c,v 1.37 2024/04/04 09:19:42 yamaguchi Exp $	*/
+/*	$NetBSD: if_lagg_lacp.c,v 1.38 2024/04/05 06:07:36 yamaguchi Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-NetBSD
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lagg_lacp.c,v 1.37 2024/04/04 09:19:42 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg_lacp.c,v 1.38 2024/04/05 06:07:36 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lagg.h"
@@ -1290,7 +1290,7 @@ lacp_rcvdu_work(struct lagg_work *lw __u
 	struct lagg_port *lp;
 	struct mbuf *m;
 	uint8_t subtype;
-	int bound, s;
+	int bound, s0, s1;
 
 	bound = curlwp_bind();
 
@@ -1299,23 +1299,26 @@ lacp_rcvdu_work(struct lagg_work *lw __u
 		if (m == NULL)
 			break;
 
-		ifp = m_get_rcvif(m, &s);
+		ifp = m_get_rcvif(m, &s0);
 		if (ifp == NULL) {
 			m_freem(m);
 			lsc->lsc_norcvif.ev_count++;
 			continue;
 		}
 
+		s1 = pserialize_read_enter();
 		lp = atomic_load_consume(&ifp->if_lagg);
 		if (lp == NULL) {
-			m_put_rcvif(ifp, &s);
+			pserialize_read_exit(s1);
+			m_put_rcvif(ifp, &s0);
 			m_freem(m);
 			lsc->lsc_norcvif.ev_count++;
 			continue;
 		}
 
 		lagg_port_getref(lp, &psref_lp);
-		m_put_rcvif(ifp, &s);
+		pserialize_read_exit(s1);
+		m_put_rcvif(ifp, &s0);
 
 		m_copydata(m, sizeof(struct ether_header),
 		    sizeof(subtype), &subtype);

Reply via email to