Source-Changes-HG archive

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

[src/trunk]: src/sbin/ping6 put back the byte swapping code, and remove the d...



details:   https://anonhg.NetBSD.org/src/rev/fed533e29e55
branches:  trunk
changeset: 769126:fed533e29e55
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Aug 31 22:27:26 2011 +0000

description:
put back the byte swapping code, and remove the double byte swapping.

diffstat:

 sbin/ping6/ping6.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 25aa6371b95d -r fed533e29e55 sbin/ping6/ping6.c
--- a/sbin/ping6/ping6.c        Wed Aug 31 22:16:54 2011 +0000
+++ b/sbin/ping6/ping6.c        Wed Aug 31 22:27:26 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ping6.c,v 1.76 2011/08/31 22:05:57 riz Exp $   */
+/*     $NetBSD: ping6.c,v 1.77 2011/08/31 22:27:26 christos Exp $      */
 /*     $KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $ */
 
 /*
@@ -77,7 +77,7 @@
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ping6.c,v 1.76 2011/08/31 22:05:57 riz Exp $");
+__RCSID("$NetBSD: ping6.c,v 1.77 2011/08/31 22:27:26 christos Exp $");
 #endif
 #endif
 
@@ -1202,6 +1202,7 @@
        icp->icmp6_cksum = 0;
        seq = ntransmitted++;
        CLR(seq % mx_dup_ck);
+       seq = ntohs(seq);
 
        if (options & F_FQDN) {
                icp->icmp6_code = ICMP6_NI_SUBJ_IPV6;
@@ -1246,7 +1247,7 @@
                icp->icmp6_type = ICMP6_ECHO_REQUEST;
                icp->icmp6_code = 0;
                icp->icmp6_id = htons(ident);
-               icp->icmp6_seq = ntohs(seq);
+               icp->icmp6_seq = seq;
                if (timing) {
                        struct timeval tv;
                        struct tv32 *tv32;



Home | Main Index | Thread Index | Old Index