diff options
Diffstat (limited to 'networking/ping.c')
-rw-r--r-- | networking/ping.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/networking/ping.c b/networking/ping.c index 5f7e5b9b5..318d561bb 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -332,6 +332,11 @@ static int common_ping_main(sa_family_t af, char **argv) | |||
332 | 332 | ||
333 | create_icmp_socket(lsa); | 333 | create_icmp_socket(lsa); |
334 | G.myid = (uint16_t) getpid(); | 334 | G.myid = (uint16_t) getpid(); |
335 | /* we can use native-endian ident, but other Unix ping/traceroute | ||
336 | * utils use *big-endian pid*, and e.g. traceroute on our machine may be | ||
337 | * *not* from busybox, idents may collide. Follow the convention: | ||
338 | */ | ||
339 | G.myid = htons(G.myid); | ||
335 | #if ENABLE_PING6 | 340 | #if ENABLE_PING6 |
336 | if (lsa->u.sa.sa_family == AF_INET6) | 341 | if (lsa->u.sa.sa_family == AF_INET6) |
337 | ping6(lsa); | 342 | ping6(lsa); |
@@ -927,6 +932,11 @@ static int common_ping_main(int opt, char **argv) | |||
927 | G.interval_us = interval * 1000000; | 932 | G.interval_us = interval * 1000000; |
928 | 933 | ||
929 | myid = (uint16_t) getpid(); | 934 | myid = (uint16_t) getpid(); |
935 | /* we can use native-endian ident, but other Unix ping/traceroute | ||
936 | * utils use *big-endian pid*, and e.g. traceroute on our machine may be | ||
937 | * *not* from busybox, idents may collide. Follow the convention: | ||
938 | */ | ||
939 | myid = htons(myid); | ||
930 | hostname = argv[optind]; | 940 | hostname = argv[optind]; |
931 | #if ENABLE_PING6 | 941 | #if ENABLE_PING6 |
932 | { | 942 | { |