ping[6]: don't do htons(a++), it can be a macro

This commit is contained in:
Denis Vlasenko
2007-01-03 22:14:18 +00:00
parent b36b370fbe
commit 919c10dd88
2 changed files with 4 additions and 2 deletions

View File

@ -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));