summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-10 20:30:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-10 20:30:47 +0000
commit33c3054b18f4e1f3548b60962face634c0e44988 (patch)
tree07e4247f8f2d82779c1933d2ff5d5616564daee2
parentf5a6bd6e1a5c0904abdfe4203aa0c0b9224efe5f (diff)
follow post-2.1 ip_off & ip_len byte orders
-rw-r--r--usr.sbin/mrinfo/mrinfo.c2
-rw-r--r--usr.sbin/mrouted/igmp.c2
-rw-r--r--usr.sbin/mtrace/mtrace.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/mrinfo/mrinfo.c b/usr.sbin/mrinfo/mrinfo.c
index 2bf1c403584..1bfa27e267b 100644
--- a/usr.sbin/mrinfo/mrinfo.c
+++ b/usr.sbin/mrinfo/mrinfo.c
@@ -514,7 +514,7 @@ main(argc, argv)
src = ip->ip_src.s_addr;
dst = ip->ip_dst.s_addr;
iphdrlen = ip->ip_hl << 2;
- ipdatalen = ip->ip_len;
+ ipdatalen = ntohs(ip->ip_len);
if (iphdrlen + ipdatalen != recvlen) {
log(LOG_WARNING, 0,
"packet shorter (%u bytes) than hdr+data length (%u+%u)",
diff --git a/usr.sbin/mrouted/igmp.c b/usr.sbin/mrouted/igmp.c
index 2efb6d319b3..5ac21537f4c 100644
--- a/usr.sbin/mrouted/igmp.c
+++ b/usr.sbin/mrouted/igmp.c
@@ -152,7 +152,7 @@ accept_igmp(recvlen)
}
iphdrlen = ip->ip_hl << 2;
- ipdatalen = ip->ip_len;
+ ipdatalen = ntohs(ip->ip_len);
if (iphdrlen + ipdatalen != recvlen) {
log(LOG_WARNING, 0,
"received packet from %s shorter (%u bytes) than hdr+data length (%u+%u)",
diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c
index 16f97a4ddba..a62efd2932f 100644
--- a/usr.sbin/mtrace/mtrace.c
+++ b/usr.sbin/mtrace/mtrace.c
@@ -52,7 +52,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Id: mtrace.c,v 1.8 2001/09/05 22:32:45 deraadt Exp $";
+ "@(#) $Id: mtrace.c,v 1.9 2001/12/10 20:30:46 deraadt Exp $";
#endif
#include <netdb.h>
@@ -501,7 +501,7 @@ send_recv(dst, type, code, tries, save)
continue;
iphdrlen = ip->ip_hl << 2;
- ipdatalen = ip->ip_len;
+ ipdatalen = ntohs(ip->ip_len);
if (iphdrlen + ipdatalen != recvlen) {
fprintf(stderr,
"packet shorter (%u bytes) than hdr+data len (%u+%u)\n",
@@ -657,7 +657,7 @@ passive_mode()
continue;
iphdrlen = ip->ip_hl << 2;
- ipdatalen = ip->ip_len;
+ ipdatalen = ntohs(ip->ip_len);
if (iphdrlen + ipdatalen != recvlen) {
fprintf(stderr,
"packet shorter (%u bytes) than hdr+data len (%u+%u)\n",