Module Name:    src
Committed By:   yamaguchi
Date:           Thu Apr  4 08:29:25 UTC 2024

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

Log Message:
lagg(4): move comment about IFF_PROMISC

pointed out by ozaki-r@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 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.61 src/sys/net/lagg/if_lagg.c:1.62
--- src/sys/net/lagg/if_lagg.c:1.61	Thu Apr  4 08:26:32 2024
+++ src/sys/net/lagg/if_lagg.c	Thu Apr  4 08:29:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_lagg.c,v 1.61 2024/04/04 08:26:32 yamaguchi Exp $	*/
+/*	$NetBSD: if_lagg.c,v 1.62 2024/04/04 08:29:25 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.61 2024/04/04 08:26:32 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.62 2024/04/04 08:29:25 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1139,11 +1139,6 @@ lagg_input_ethernet(struct ifnet *ifp_po
 
 	ifp = &lp->lp_softc->sc_if;
 
-	/*
-	 * Drop promiscuously received packets
-	 * if we are not in promiscuous mode.
-	 */
-
 	if (__predict_false(m->m_len < (int)sizeof(*eh))) {
 		if ((m = m_pullup(m, sizeof(*eh))) == NULL) {
 			if_statinc(ifp, if_ierrors);
@@ -1166,6 +1161,10 @@ lagg_input_ethernet(struct ifnet *ifp_po
 
 		if_statinc(ifp_port, if_imcasts);
 	} else {
+		/*
+		 * Drop promiscuously received packets
+		 * if we are not in promiscuous mode.
+		 */
 		if ((ifp->if_flags & IFF_PROMISC) == 0 &&
 		    (ifp_port->if_flags & IFF_PROMISC) != 0 &&
 		    memcmp(CLLADDR(ifp->if_sadl), eh->ether_dhost,

Reply via email to