Date: Fri, 12 Oct 2012 09:24:24 +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: r241480 - head/sys/netinet Message-ID: <201210120924.q9C9OOQj076094@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210120924.q9C9OOQj076094>