Module Name:    src
Committed By:   jdolecek
Date:           Wed Jul 29 13:00:26 UTC 2020

Modified Files:
        src/sys/dev/pci: xmm7360.c

Log Message:
adjust OpenBSD mbuf handling so tcpdump(1) works there; from genua

keep code as-is for NetBSD, DLT_RAW works there


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/xmm7360.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/dev/pci/xmm7360.c
diff -u src/sys/dev/pci/xmm7360.c:1.3 src/sys/dev/pci/xmm7360.c:1.4
--- src/sys/dev/pci/xmm7360.c:1.3	Mon Jul 27 14:09:00 2020
+++ src/sys/dev/pci/xmm7360.c	Wed Jul 29 13:00:26 2020
@@ -74,7 +74,7 @@ MODULE_DEVICE_TABLE(pci, xmm7360_ids);
 #include "opt_gateway.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.3 2020/07/27 14:09:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.4 2020/07/29 13:00:26 jdolecek Exp $");
 #endif
 
 #include <sys/param.h>
@@ -3029,6 +3029,10 @@ wwan_if_input(struct ifnet *ifp, struct 
 		/* NOTREACHED */
 	}
 
+	/* Needed for tcpdump(1) et.al */
+	m->m_pkthdr.ph_rtableid = ifp->if_rdomain;
+	m_adj(m, sizeof(u_int32_t));
+
 	(*input)(ifp, m);
 	return 1;
 }
@@ -3242,8 +3246,13 @@ wwan_attach(struct device *parent, struc
 	if_deferred_start_init(ifp, NULL);
 	if_alloc_sadl(ifp);
 #if NBPFILTER > 0
+#ifdef __OpenBSD__
+	bpfattach(&ifp->if_bpf, ifp, DLT_LOOP, sizeof(u_int32_t));
+#endif
+#ifdef __NetBSD__
 	bpfattach(&ifp->if_bpf, ifp, DLT_RAW, 0);
 #endif
+#endif
 
 	printf("\n");
 

Reply via email to