summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2021-03-20 01:15:28 +0000
committerdlg <dlg@openbsd.org>2021-03-20 01:15:28 +0000
commit2a78f6c46e4a7f777fd4f7fb86bcab2b86c07636 (patch)
treebcae567d51099bc6d560ba6b59d740ce8f61ad43
parentRemove libLLVM.so.2.0 on upgrade (diff)
downloadwireguard-openbsd-2a78f6c46e4a7f777fd4f7fb86bcab2b86c07636.tar.xz
wireguard-openbsd-2a78f6c46e4a7f777fd4f7fb86bcab2b86c07636.zip
use m_dup_pkthdr in ip_fragment to copy pkthdr info to fragments.
this ensures more stuff is copied, in particular the flowid information. this is also how v6 does it, which makes things more consistent. ok bluhm@
-rw-r--r--sys/netinet/ip_output.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index cd28e534d79..c01a3e7803c 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.368 2021/03/01 11:05:42 bluhm Exp $ */
+/* $OpenBSD: ip_output.c,v 1.369 2021/03/20 01:15:28 dlg Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -688,13 +688,11 @@ ip_fragment(struct mbuf *m, struct mbuf_list *fml, struct ifnet *ifp,
goto bad;
}
ml_enqueue(fml, m);
+ if ((error = m_dup_pkthdr(m, m0, M_DONTWAIT)) != 0)
+ goto bad;
m->m_data += max_linkhdr;
mhip = mtod(m, struct ip *);
*mhip = *ip;
- /* we must inherit MCAST/BCAST flags, routing table and prio */
- m->m_flags |= m0->m_flags & (M_MCAST|M_BCAST);
- m->m_pkthdr.ph_rtableid = m0->m_pkthdr.ph_rtableid;
- m->m_pkthdr.pf.prio = m0->m_pkthdr.pf.prio;
if (hlen > sizeof (struct ip)) {
mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
mhip->ip_hl = mhlen >> 2;