summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-31 11:50:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-31 11:50:14 +0000
commitf178eadad00deb410fd6d0bfa8d25c2536b78b3c (patch)
treec37fffb6fa47c3df52c5ee45e68b4013451138e0 /sys/netinet
parentbdc9fdb23fd6d66fd0a08afe4c49045dc6d560cc (diff)
icmp_error() is now getting packets which are completely in network byte order
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_icmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index e77c5e694d2..41cb32c7134 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.10 1998/05/27 20:28:35 deraadt Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.11 1998/12/31 11:50:13 deraadt Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -104,7 +104,7 @@ icmp_error(n, type, code, dest, destifp)
* Don't error if the old packet protocol was ICMP
* error message, only known informational types.
*/
- if (oip->ip_off &~ (IP_MF|IP_DF))
+ if (ntohs(oip->ip_off) &~ (IP_MF|IP_DF))
goto freeit;
if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
n->m_len >= oiplen + ICMP_MINLEN &&
@@ -121,7 +121,7 @@ icmp_error(n, type, code, dest, destifp)
m = m_gethdr(M_DONTWAIT, MT_HEADER);
if (m == NULL)
goto freeit;
- icmplen = oiplen + min(8,oip->ip_len);
+ icmplen = oiplen + min(8, ntohs(oip->ip_len));
m->m_len = icmplen + ICMP_MINLEN;
MH_ALIGN(m, m->m_len);
icp = mtod(m, struct icmp *);