From 33c3054b18f4e1f3548b60962face634c0e44988 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 10 Dec 2001 20:30:47 +0000 Subject: follow post-2.1 ip_off & ip_len byte orders --- usr.sbin/mrinfo/mrinfo.c | 2 +- usr.sbin/mrouted/igmp.c | 2 +- usr.sbin/mtrace/mtrace.c | 6 +++--- 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 @@ -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", -- cgit v1.2.3