From 9e2a372fd2050fe1a997af722890aba9870f5a78 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 23 Oct 2012 10:30:09 +0000 Subject: [PATCH] Use ip_stripoptions() instead of handrolled version. --- sys/netinet/ip_icmp.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index eb9c1ad85517..d6fd5bafc9b3 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);