summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_options.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-23 08:33:13 +0000
committerglebius <glebius@FreeBSD.org>2012-10-23 08:33:13 +0000
commitfea857f2a843cb039f3757ef79ba28b083d7a0c3 (patch)
tree3f8a671ee4ada31ed0990132b9e47b3cd8a49bc2 /sys/netinet/ip_options.c
parent6a485e417ac3a2996d760532faaf5a48a890d223 (diff)
downloadFreeBSD-src-fea857f2a843cb039f3757ef79ba28b083d7a0c3.zip
FreeBSD-src-fea857f2a843cb039f3757ef79ba28b083d7a0c3.tar.gz
Do not reduce ip_len by size of IP header in the ip_input()
before passing a packet to protocol input routines. For several protocols this mean that now protocol needs to do subtraction itself, and for another half this means that we do not need to add header length back to the packet. Make ip_stripoptions() to adjust ip_len, since now we enter this function with a packet header whose ip_len does represent length of entire packet, not payload only.
Diffstat (limited to 'sys/netinet/ip_options.c')
-rw-r--r--sys/netinet/ip_options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c
index 54a66b6..5083f6f 100644
--- a/sys/netinet/ip_options.c
+++ b/sys/netinet/ip_options.c
@@ -470,7 +470,7 @@ ip_stripoptions(struct mbuf *m)
m->m_len -= olen;
if (m->m_flags & M_PKTHDR)
m->m_pkthdr.len -= olen;
- ip->ip_v = IPVERSION;
+ ip->ip_len = htons(ntohs(ip->ip_len) - olen);
ip->ip_hl = sizeof(struct ip) >> 2;
}
OpenPOWER on IntegriCloud