Use ip_stripoptions() instead of handrolled version.

This commit is contained in:
Gleb Smirnoff 2012-10-23 10:30:09 +00:00
parent 4937a6561f
commit 9e2a372fd2

View File

@ -857,19 +857,7 @@ icmp_reflect(struct mbuf *m)
printf("%d\n", opts->m_len);
#endif
}
/*
* Now strip out original options by copying rest of first
* mbuf's data back, and adjust the IP length.
*/
ip->ip_len = htons(ntohs(ip->ip_len) - optlen);
ip->ip_v = IPVERSION;
ip->ip_hl = 5;
m->m_len -= optlen;
if (m->m_flags & M_PKTHDR)
m->m_pkthdr.len -= optlen;
optlen += sizeof(struct ip);
bcopy((caddr_t)ip + optlen, (caddr_t)(ip + 1),
(unsigned)(m->m_len - sizeof(struct ip)));
ip_stripoptions(m);
}
m_tag_delete_nonpersistent(m);
m->m_flags &= ~(M_BCAST|M_MCAST);