summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-23 10:30:09 +0000
committerglebius <glebius@FreeBSD.org>2012-10-23 10:30:09 +0000
commit285432154c16cc537d0a1a34ba3212303c010fe8 (patch)
treeac0fd9657ea88c08eb85df523fd82d908e90f893 /sys/netinet
parente4588fbb85bd0666ca8a968aaa2ec629cec2991f (diff)
downloadFreeBSD-src-285432154c16cc537d0a1a34ba3212303c010fe8.zip
FreeBSD-src-285432154c16cc537d0a1a34ba3212303c010fe8.tar.gz
Use ip_stripoptions() instead of handrolled version.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_icmp.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index eb9c1ad..d6fd5ba 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -857,19 +857,7 @@ match:
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);
OpenPOWER on IntegriCloud