summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2021-03-20 01:15:29 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2021-03-20 01:15:29 +0000
commitc647613b6606be783090426711d639e0477c2e7d (patch)
tree4f36d2e0e325f952271fee25be48663feae8c08c /sys/netinet
parent2055c5cd9b4faf2c43096d35e61dfb2612d38b34 (diff)
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@
Diffstat (limited to 'sys/netinet')
-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;