summaryrefslogtreecommitdiff
path: root/networking/ping.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-01-03 22:14:18 +0000
committerDenis Vlasenko2007-01-03 22:14:18 +0000
commit919c10dd8884aa4876ec6ca407a12f3793f2bab1 (patch)
tree54d17a4ecceace5a12e0823204a46a9396db756d /networking/ping.c
parentb36b370fbec946290e5b3d149d4d14a0db458cfa (diff)
downloadbusybox-919c10dd8884aa4876ec6ca407a12f3793f2bab1.zip
busybox-919c10dd8884aa4876ec6ca407a12f3793f2bab1.tar.gz
ping[6]: don't do htons(a++), it can be a macro
Diffstat (limited to 'networking/ping.c')
-rw-r--r--networking/ping.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/ping.c b/networking/ping.c
index acbb8ec..8b49df1 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));