From owner-svn-src-all@FreeBSD.ORG Fri Oct 12 09:24:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D23ABBCD; Fri, 12 Oct 2012 09:24:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A23B88FC12; Fri, 12 Oct 2012 09:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9C9OObR076099; Fri, 12 Oct 2012 09:24:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9C9OOQj076094; Fri, 12 Oct 2012 09:24:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210120924.q9C9OOQj076094@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 12 Oct 2012 09:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241480 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 09:24:24 -0000 Author: glebius Date: Fri Oct 12 09:24:24 2012 New Revision: 241480 URL: http://svn.freebsd.org/changeset/base/241480 Log: In ip_stripoptions(): - Remove unused argument and incorrect comment. - Fixup ip_len after stripping. Modified: head/sys/netinet/ip_options.c head/sys/netinet/ip_options.h head/sys/netinet/tcp_input.c head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Fri Oct 12 06:16:51 2012 (r241479) +++ head/sys/netinet/ip_options.c Fri Oct 12 09:24:24 2012 (r241480) @@ -453,14 +453,10 @@ ip_srcroute(struct mbuf *m0) } /* - * Strip out IP options, at higher level protocol in the kernel. Second - * argument is buffer to which options will be moved, and return value is - * their length. - * - * XXX should be deleted; last arg currently ignored. + * Strip out IP options, at higher level protocol in the kernel. */ void -ip_stripoptions(struct mbuf *m, struct mbuf *mopt) +ip_stripoptions(struct mbuf *m) { int i; struct ip *ip = mtod(m, struct ip *); @@ -476,6 +472,7 @@ ip_stripoptions(struct mbuf *m, struct m m->m_pkthdr.len -= olen; ip->ip_v = IPVERSION; ip->ip_hl = sizeof(struct ip) >> 2; + ip->ip_len -= olen; } /* Modified: head/sys/netinet/ip_options.h ============================================================================== --- head/sys/netinet/ip_options.h Fri Oct 12 06:16:51 2012 (r241479) +++ head/sys/netinet/ip_options.h Fri Oct 12 09:24:24 2012 (r241480) @@ -54,7 +54,7 @@ int ip_dooptions(struct mbuf *, int); struct mbuf *ip_insertoptions(struct mbuf *, struct mbuf *, int *); int ip_optcopy(struct ip *, struct ip *); int ip_pcbopts(struct inpcb *, int, struct mbuf *); -void ip_stripoptions(struct mbuf *, struct mbuf *); +void ip_stripoptions(struct mbuf *); struct mbuf *ip_srcroute(struct mbuf *); #endif /* !_NETINET_IP_OPTIONS_H_ */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Oct 12 06:16:51 2012 (r241479) +++ head/sys/netinet/tcp_input.c Fri Oct 12 09:24:24 2012 (r241480) @@ -632,7 +632,7 @@ tcp_input(struct mbuf *m, int off0) * Note: IP leaves IP header in first mbuf. */ if (off0 > sizeof (struct ip)) { - ip_stripoptions(m, (struct mbuf *)0); + ip_stripoptions(m); off0 = sizeof(struct ip); } if (m->m_len < sizeof (struct tcpiphdr)) { Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri Oct 12 06:16:51 2012 (r241479) +++ head/sys/netinet/udp_usrreq.c Fri Oct 12 09:24:24 2012 (r241480) @@ -354,7 +354,7 @@ udp_input(struct mbuf *m, int off) * check the checksum with options still present. */ if (iphlen > sizeof (struct ip)) { - ip_stripoptions(m, (struct mbuf *)0); + ip_stripoptions(m); iphlen = sizeof(struct ip); }