From e895248babca3545346064ebd563740c78101c94 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 26 Feb 2004 20:48:30 +0000 Subject: fix datalen, from Esben Norby. ok deraadt itojun --- usr.sbin/mtrace/mtrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/mtrace/mtrace.c') diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c index 57264be50af..092614c7820 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.21 2003/11/26 01:17:12 millert Exp $"; + "@(#) $Id: mtrace.c,v 1.22 2004/02/26 20:48:29 tedu Exp $"; #endif #include @@ -493,7 +493,7 @@ send_recv(dst, type, code, tries, save) continue; iphdrlen = ip->ip_hl << 2; - ipdatalen = ntohs(ip->ip_len); + ipdatalen = ntohs(ip->ip_len) - iphdrlen; if (iphdrlen + ipdatalen != recvlen) { fprintf(stderr, "packet shorter (%u bytes) than hdr+data len (%u+%u)\n", @@ -647,7 +647,7 @@ passive_mode(void) continue; iphdrlen = ip->ip_hl << 2; - ipdatalen = ntohs(ip->ip_len); + ipdatalen = ntohs(ip->ip_len) - iphdrlen; if (iphdrlen + ipdatalen != recvlen) { fprintf(stderr, "packet shorter (%u bytes) than hdr+data len (%u+%u)\n", -- cgit v1.2.3