summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorJan Klemkow <jan@cvs.openbsd.org>2024-01-26 21:14:09 +0000
committerJan Klemkow <jan@cvs.openbsd.org>2024-01-26 21:14:09 +0000
commit8fcca248b4dc1e30ca1dbbbe19825c7c48723f6e (patch)
tree9018f51b56ab7a422559d26708322c00559e8af1 /sys/net
parent6992dff57c09fa64ae0eafb8d6217b8417eee397 (diff)
Put checksum flags in bpf_hdr to use them in userland dhcpleased.
Thus, dhcpleased accept non-calculated checksums which were verified by hardware/hypervisor. With tweaks from dlg@ ok bluhm@ mkay tobhe@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c4
-rw-r--r--sys/net/bpf.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index b05c5177f6e..51a1ed66ff4 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.221 2023/03/09 05:56:58 dlg Exp $ */
+/* $OpenBSD: bpf.c,v 1.222 2024/01/26 21:14:08 jan Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -1397,6 +1397,8 @@ _bpf_mtap(caddr_t arg, const struct mbuf *mp, const struct mbuf *m,
if (ISSET(mp->m_pkthdr.csum_flags,
M_FLOWID))
SET(tbh.bh_flags, BPF_F_FLOWID);
+ tbh.bh_csumflags =
+ mp->m_pkthdr.csum_flags;
m_microtime(mp, &tv);
} else
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
index 9ce4dcd63a4..ab64061fb97 100644
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.h,v 1.71 2023/03/09 05:56:58 dlg Exp $ */
+/* $OpenBSD: bpf.h,v 1.72 2024/01/26 21:14:08 jan Exp $ */
/* $NetBSD: bpf.h,v 1.15 1996/12/13 07:57:33 mikel Exp $ */
/*
@@ -161,6 +161,7 @@ struct bpf_hdr {
#define BPF_F_DIR_IN (BPF_DIRECTION_IN << BPF_F_DIR_SHIFT)
#define BPF_F_DIR_OUT (BPF_DIRECTION_OUT << BPF_F_DIR_SHIFT)
u_int8_t bh_drops;
+ u_int16_t bh_csumflags; /* checksum flags */
};
#ifdef _KERNEL