-
- } else { /* more fragments */
-
- /* allocate header mbuf for next fragment */
-
- if ((mm = m_get(1)) == NULL) /* no more bufs */
- return(0);
-
- p->ip_off |= ip_mf;
-
- /* terminate fragment at 8 byte boundary (round down) */
-
- i -= m->m_len;
- rnd = i & ~7; /* fragment length */
- adj = i - rnd; /* leftover in mbuf */
- p->ip_len = rnd + hlen;
-
- /* setup header for next fragment and
- append remaining fragment data */
-
- n->m_next = NULL;
- mm->m_next = m;
- m = mm;
- m->m_off = MSIZE - hlen - adj;
- m->m_len = hlen + adj;
-
- /* copy old header to new */
-
- bcopy(p, (caddr_t)((int)m + m->m_off), hlen);
-
- /* copy leftover data from previous frag */
-
- if (adj) {
- n->m_len -= adj;
- bcopy((caddr_t)((int)n + n->m_len + n->m_off),
- (caddr_t)((int)m + m->m_off + hlen), adj);
- }
- }
-
- ip_send(p); /* pass frag to local net level */
-
- p = (struct ip *)((int)m + m->m_off); /* -> new hdr */
- len -= rnd;
- off += rnd;