summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMaxime Henrion <mux@FreeBSD.org>2003-03-25 23:49:14 +0000
committerMaxime Henrion <mux@FreeBSD.org>2003-03-25 23:49:14 +0000
commit511e01e2d678c362d84700678c2b0da517c37b82 (patch)
treeabe734adcc783ce55fa2f57270f01b0e26077cbd /sys/netinet
parent84b7dcad85be5859cdc14f8e375ed75473677997 (diff)
downloadsrc-test2-511e01e2d678c362d84700678c2b0da517c37b82.tar.gz
src-test2-511e01e2d678c362d84700678c2b0da517c37b82.zip
Notes
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 02fb2d314524..c00ac4cd512e 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1021,25 +1021,23 @@ pass:
#endif
#ifdef MBUF_FRAG_TEST
- if (mbuf_frag_size) {
+ if (mbuf_frag_size && m->m_pkthdr.len > mbuf_frag_size) {
struct mbuf *m1, *m2;
- int length;
+ int length, tmp;
- length = m->m_len;
+ tmp = length = m->m_pkthdr.len;
- while (1) {
- length -= mbuf_frag_size;
- if (length < 1)
- break;
+ while ((length -= mbuf_frag_size) >= 1) {
m1 = m_split(m, length, M_DONTWAIT);
+ if (m1 == NULL)
+ break;
+ m1->m_flags &= ~M_PKTHDR;
m2 = m;
- while (1) {
- if (m2->m_next == NULL)
- break;
+ while (m2->m_next != NULL)
m2 = m2->m_next;
- }
- m2->m_next = m1;
+ m2->m_next = m1;
}
+ m->m_pkthdr.len = tmp;
}
#endif
error = (*ifp->if_output)(ifp, m,