svn commit: r278832 - head/sys/netinet6
Gleb Smirnoff
glebius at FreeBSD.org
Mon Feb 16 05:58:33 UTC 2015
Author: glebius
Date: Mon Feb 16 05:58:32 2015
New Revision: 278832
URL: https://svnweb.freebsd.org/changeset/base/278832
Log:
Move ip6_deletefraghdr() to frag6.c.
Suggested by: bz
Modified:
head/sys/netinet6/frag6.c
head/sys/netinet6/ip6_output.c
Modified: head/sys/netinet6/frag6.c
==============================================================================
--- head/sys/netinet6/frag6.c Mon Feb 16 03:38:27 2015 (r278831)
+++ head/sys/netinet6/frag6.c Mon Feb 16 05:58:32 2015 (r278832)
@@ -764,3 +764,27 @@ frag6_drain(void)
IP6Q_UNLOCK();
VNET_LIST_RUNLOCK_NOSLEEP();
}
+
+int
+ip6_deletefraghdr(struct mbuf *m, int offset, int wait)
+{
+ struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
+ struct mbuf *t;
+
+ /* Delete frag6 header. */
+ if (m->m_len >= offset + sizeof(struct ip6_frag)) {
+ /* This is the only possible case with !PULLDOWN_TEST. */
+ bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag),
+ offset);
+ m->m_data += sizeof(struct ip6_frag);
+ m->m_len -= sizeof(struct ip6_frag);
+ } else {
+ /* This comes with no copy if the boundary is on cluster. */
+ if ((t = m_split(m, offset, wait)) == NULL)
+ return (ENOMEM);
+ m_adj(t, sizeof(struct ip6_frag));
+ m_cat(m, t);
+ }
+
+ return (0);
+}
Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c Mon Feb 16 03:38:27 2015 (r278831)
+++ head/sys/netinet6/ip6_output.c Mon Feb 16 05:58:32 2015 (r278832)
@@ -1206,30 +1206,6 @@ ip6_insertfraghdr(struct mbuf *m0, struc
return (0);
}
-int
-ip6_deletefraghdr(struct mbuf *m, int offset, int wait)
-{
- struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
- struct mbuf *t;
-
- /* Delete frag6 header. */
- if (m->m_len >= offset + sizeof(struct ip6_frag)) {
- /* This is the only possible case with !PULLDOWN_TEST. */
- bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag),
- offset);
- m->m_data += sizeof(struct ip6_frag);
- m->m_len -= sizeof(struct ip6_frag);
- } else {
- /* This comes with no copy if the boundary is on cluster. */
- if ((t = m_split(m, offset, wait)) == NULL)
- return (ENOMEM);
- m_adj(t, sizeof(struct ip6_frag));
- m_cat(m, t);
- }
-
- return (0);
-}
-
static int
ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro,
struct ifnet *ifp, struct in6_addr *dst, u_long *mtup,
More information about the svn-src-head
mailing list