Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/traceroute6 PR/19069: SUENAGA Hiroki: Original fix ...



details:   https://anonhg.NetBSD.org/src/rev/0d938e256218
branches:  trunk
changeset: 754808:0d938e256218
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 13 18:19:18 2010 +0000

description:
PR/19069: SUENAGA Hiroki: Original fix was defective because on big endian
the expression is not truncated to 16 bits, thus sending to port 65536 makes
the == 0 test fail and the packet ends up being sent.

diffstat:

 usr.sbin/traceroute6/traceroute6.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r dab7050eaa7a -r 0d938e256218 usr.sbin/traceroute6/traceroute6.c
--- a/usr.sbin/traceroute6/traceroute6.c        Thu May 13 18:10:16 2010 +0000
+++ b/usr.sbin/traceroute6/traceroute6.c        Thu May 13 18:19:18 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: traceroute6.c,v 1.38 2009/02/16 20:36:11 is Exp $      */
+/*     $NetBSD: traceroute6.c,v 1.39 2010/05/13 18:19:18 christos Exp $        */
 /*     $KAME: traceroute6.c,v 1.67 2004/01/25 03:24:39 itojun Exp $    */
 
 /*
@@ -75,7 +75,7 @@
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: traceroute6.c,v 1.38 2009/02/16 20:36:11 is Exp $");
+__RCSID("$NetBSD: traceroute6.c,v 1.39 2010/05/13 18:19:18 christos Exp $");
 #endif
 #endif
 
@@ -864,7 +864,7 @@
                        struct timeval t1, t2;
 
                        (void) gettimeofday(&t1, NULL);
-                       if (!useicmp && htons(port + seq + 1) == 0)
+                       if (!useicmp && htons((in_port_t)(port + seq + 1)) == 0)
                                seq++;
                        send_probe(++seq, hops);
                        while ((cc = wait_for_reply(rcvsock, &rcvmhdr))) {



Home | Main Index | Thread Index | Old Index