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);
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to