summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-12 09:24:24 +0000
committerglebius <glebius@FreeBSD.org>2012-10-12 09:24:24 +0000
commit9879a454afa69e2734e4833c1af50019f15df7e6 (patch)
tree1598085a4c5d301498cab2e57c98649ad6856253
parent1f46bef563e94fd201aab281f16815e590ba45c6 (diff)
downloadFreeBSD-src-9879a454afa69e2734e4833c1af50019f15df7e6.zip
FreeBSD-src-9879a454afa69e2734e4833c1af50019f15df7e6.tar.gz
In ip_stripoptions():
- Remove unused argument and incorrect comment. - Fixup ip_len after stripping.
-rw-r--r--sys/netinet/ip_options.c9
-rw-r--r--sys/netinet/ip_options.h2
-rw-r--r--sys/netinet/tcp_input.c2
-rw-r--r--sys/netinet/udp_usrreq.c2
4 files changed, 6 insertions, 9 deletions
diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c
index 53ba713..b618445 100644
--- a/sys/netinet/ip_options.c
+++ b/sys/netinet/ip_options.c
@@ -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 mbuf *mopt)
m->m_pkthdr.len -= olen;
ip->ip_v = IPVERSION;
ip->ip_hl = sizeof(struct ip) >> 2;
+ ip->ip_len -= olen;
}
/*
diff --git a/sys/netinet/ip_options.h b/sys/netinet/ip_options.h
index 7ba5ae6..7cb447e 100644
--- a/sys/netinet/ip_options.h
+++ b/sys/netinet/ip_options.h
@@ -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_ */
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 015b1ff..3b21df1 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -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)) {
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 9f947a6..ff52577 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -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);
}
OpenPOWER on IntegriCloud