svn commit: r347465 - head/sys/netinet6
John Baldwin
jhb at FreeBSD.org
Fri May 10 20:15:41 UTC 2019
Author: jhb
Date: Fri May 10 20:15:40 2019
New Revision: 347465
URL: https://svnweb.freebsd.org/changeset/base/347465
Log:
Apply r280991 to ip6_fragment.
This uses m_dup_pkthdr() to copy all of the metadata about a packet to
each of its fragments including VLAN tags, mbuf tags, etc. instead of
hand-copying a few fields.
Reviewed by: bz
MFC after: 1 month
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20117
Modified:
head/sys/netinet6/ip6_output.c
Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c Fri May 10 19:55:29 2019 (r347464)
+++ head/sys/netinet6/ip6_output.c Fri May 10 20:15:40 2019 (r347465)
@@ -228,7 +228,20 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h
IP6STAT_INC(ip6s_odropped);
return (ENOBUFS);
}
- m->m_flags = m0->m_flags & M_COPYFLAGS;
+
+ /*
+ * Make sure the complete packet header gets copied
+ * from the originating mbuf to the newly created
+ * mbuf. This also ensures that existing firewall
+ * classification(s), VLAN tags and so on get copied
+ * to the resulting fragmented packet(s):
+ */
+ if (m_dup_pkthdr(m, m0, M_NOWAIT) == 0) {
+ m_free(m);
+ IP6STAT_INC(ip6s_odropped);
+ return (ENOBUFS);
+ }
+
*mnext = m;
mnext = &m->m_nextpkt;
m->m_data += max_linkhdr;
@@ -253,8 +266,6 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h
}
m_cat(m, m_frgpart);
m->m_pkthdr.len = fraglen + hlen + sizeof(*ip6f);
- m->m_pkthdr.fibnum = m0->m_pkthdr.fibnum;
- m->m_pkthdr.rcvif = NULL;
ip6f->ip6f_reserved = 0;
ip6f->ip6f_ident = id;
ip6f->ip6f_nxt = nextproto;
More information about the svn-src-all
mailing list