summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2020-07-29 13:00:26 +0000
committerjdolecek <jdolecek@NetBSD.org>2020-07-29 13:00:26 +0000
commit3736fb3ca7f9f2917aedd9f28ef5082e16647ce9 (patch)
tree06c4e1479c7d1f67c4af1ac1d2de1c0e31e15671 /sys/dev
parent8a130da872f3e7dd9329d78ce8e6c6469634ba8b (diff)
adjust OpenBSD mbuf handling so tcpdump(1) works there; from genua
keep code as-is for NetBSD, DLT_RAW works there
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/xmm7360.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/pci/xmm7360.c b/sys/dev/pci/xmm7360.c
index eeddfb59958..0f24f97cde0 100644
--- a/sys/dev/pci/xmm7360.c
+++ b/sys/dev/pci/xmm7360.c
@@ -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 mbuf *m, void *cookie)
/* 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, struct device *self, void *aux)
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");