backport htons(ntransmitted++) fix 1_3_stable
authorDenis Vlasenko <vda.linux@googlemail.com>
Thu, 1 Feb 2007 23:11:04 +0000 (23:11 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Thu, 1 Feb 2007 23:11:04 +0000 (23:11 -0000)
networking/ping.c
networking/ping6.c

index 658c015180dde346f32e4fa3f515db695f92ecb2..51771cdfcd94aaf2046a5e7662ae3ca988ec715b 100644 (file)
@@ -217,9 +217,10 @@ static void sendping(int junk)
        pkt->icmp_type = ICMP_ECHO;
        pkt->icmp_code = 0;
        pkt->icmp_cksum = 0;
-       pkt->icmp_seq = htons(ntransmitted++);
+       pkt->icmp_seq = htons(ntransmitted);
        pkt->icmp_id = myid;
        CLR(ntohs(pkt->icmp_seq) % MAX_DUP_CHK);
+       ntransmitted++;
 
        gettimeofday((struct timeval *) &pkt->icmp_dun, NULL);
        pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
index 9f0509e661b973cd768a592e5df86fd99e1a655c..c4127fd992715f3f123ece6d7379a9ddd588b2c4 100644 (file)
@@ -205,9 +205,10 @@ static void sendping(int junk)
        pkt->icmp6_type = ICMP6_ECHO_REQUEST;
        pkt->icmp6_code = 0;
        pkt->icmp6_cksum = 0;
-       pkt->icmp6_seq = htons(ntransmitted++);
+       pkt->icmp6_seq = htons(ntransmitted);
        pkt->icmp6_id = myid;
        CLR(pkt->icmp6_seq % MAX_DUP_CHK);
+       ntransmitted++;
 
        gettimeofday((struct timeval *) &pkt->icmp6_data8[4], NULL);