Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2012 10:30:10 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241926 - head/sys/netinet
Message-ID:  <201210231030.q9NAUAIr040621@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Oct 23 10:30:09 2012
New Revision: 241926
URL: http://svn.freebsd.org/changeset/base/241926

Log:
    Use ip_stripoptions() instead of handrolled version.

Modified:
  head/sys/netinet/ip_icmp.c

Modified: head/sys/netinet/ip_icmp.c
==============================================================================
--- head/sys/netinet/ip_icmp.c	Tue Oct 23 10:29:31 2012	(r241925)
+++ head/sys/netinet/ip_icmp.c	Tue Oct 23 10:30:09 2012	(r241926)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210231030.q9NAUAIr040621>