diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2020-07-21 22:44:56 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2020-07-21 22:44:56 +0000 |
commit | 890d0bf4e9f0cf34e51c8ace0dac0e2c9a0ae85b (patch) | |
tree | 08ae39c52085bfa3028f09ed29fe3dbca995e36e /lib/libpcap | |
parent | ab397fb8768506fb536529d9f517975af6590134 (diff) |
DLT_LOOP does have a link header, so tell pcap-filter so it can use it.
matthieu@ reported that asking tcpdump to look at ip or ip6 traffic
on a wg(4) interface caused all packets to be captured. this is
because pcap assumes that if your link type doesn't have a link
header then it is always ip or ip6 (which is weird anyway) and
captures everything.
there was already code to generate a filter for the DLT_LOOP link
header, it was just bypassed cos earlier code said that there wasn't
one.
debugged with and ok kn@
Diffstat (limited to 'lib/libpcap')
-rw-r--r-- | lib/libpcap/gencode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c index 44d791b0644..2adb0f92a9e 100644 --- a/lib/libpcap/gencode.c +++ b/lib/libpcap/gencode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gencode.c,v 1.52 2018/12/09 15:07:06 denis Exp $ */ +/* $OpenBSD: gencode.c,v 1.53 2020/07/21 22:44:55 dlg Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998 @@ -770,7 +770,7 @@ init_linktype(type) return; case DLT_LOOP: - off_linktype = -1; + off_linktype = 0; off_nl = 4; return; |