summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-12-31 12:55:46 +0000
committerderaadt <deraadt@openbsd.org>1998-12-31 12:55:46 +0000
commitce978843b81057a0675221185e54a3f67d63a16e (patch)
tree8a9f3a9220ca2c62037145dd29b7838b88d23aa4
parentlook at that, correct nested ip checksums... (diff)
downloadwireguard-openbsd-ce978843b81057a0675221185e54a3f67d63a16e.tar.xz
wireguard-openbsd-ce978843b81057a0675221185e54a3f67d63a16e.zip
one last fix for byte order. now all architectures return the same correct icmp packets
-rw-r--r--sys/netinet/ip_icmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 49ceef42a68..5ecf31a133e 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.13 1998/12/31 12:40:34 deraadt Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.14 1998/12/31 12:55:46 deraadt Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -148,7 +148,7 @@ icmp_error(n, type, code, dest, destifp)
icp->icmp_code = code;
bcopy((caddr_t)oip, (caddr_t)&icp->icmp_ip, icmplen);
nip = &icp->icmp_ip;
- nip->ip_len = htons((u_int16_t)(nip->ip_len + oiplen));
+ nip->ip_len = htons((u_int16_t)(ntohs(nip->ip_len) + oiplen));
m0.m_next = NULL; /* correct nip->ip_sum */
m0.m_data = (char *)nip;