aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-02-01 23:11:04 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-02-01 23:11:04 +0000
commitc71db663ded180cb368183af6812c46e460e145a (patch)
tree82e0a3e3649e315f4b75c77e0dc8115cb364cfd9
parent8b7f6928c69a53fbcc56c7b0b9db14e79ba976da (diff)
downloadbusybox-1_3_stable.tar.gz
busybox-1_3_stable.tar.bz2
backport htons(ntransmitted++) fix1_3_stable
-rw-r--r--networking/ping.c3
-rw-r--r--networking/ping6.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/networking/ping.c b/networking/ping.c
index 658c01518..51771cdfc 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -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));
diff --git a/networking/ping6.c b/networking/ping6.c
index 9f0509e66..c4127fd99 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -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);