From: Denis Vlasenko Date: Wed, 3 Jan 2007 22:14:18 +0000 (-0000) Subject: ping[6]: don't do htons(a++), it can be a macro X-Git-Tag: 1_4_0~118 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=919c10dd8884aa4876ec6ca407a12f3793f2bab1;p=oweals%2Fbusybox.git ping[6]: don't do htons(a++), it can be a macro --- diff --git a/networking/ping.c b/networking/ping.c index acbb8ec6f..8b49df1bd 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -218,9 +218,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); /* don't ++ here, it can be a macro */ 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)); diff --git a/networking/ping6.c b/networking/ping6.c index 778dcd4f5..c0b31c752 100644 --- a/networking/ping6.c +++ b/networking/ping6.c @@ -206,9 +206,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); /* don't ++ here, it can be a macro */ pkt->icmp6_id = myid; CLR(pkt->icmp6_seq % MAX_DUP_CHK); + ntransmitted++; gettimeofday((struct timeval *) &pkt->icmp6_data8[4], NULL);