From e0b7f71d26d224bd8304d9dfcac3fe9b9d862cd2 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 2 Sep 2006 16:57:59 +0000 Subject: [PATCH] ping(6): use htons instead of SWAP_BE. --- networking/ping.c | 6 +++--- networking/ping6.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/networking/ping.c b/networking/ping.c index 18fb926ad..4269eaa6f 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -209,7 +209,7 @@ static void sendping(int junk) pkt->icmp_type = ICMP_ECHO; pkt->icmp_code = 0; pkt->icmp_cksum = 0; - pkt->icmp_seq = SWAP_BE16(ntransmitted++); + pkt->icmp_seq = htons(ntransmitted++); pkt->icmp_id = myid; CLR(ntohs(pkt->icmp_seq) % MAX_DUP_CHK); @@ -235,7 +235,7 @@ static void sendping(int junk) } } -static char *icmp_type_name (int id) +static char *icmp_type_name(int id) { switch (id) { case ICMP_ECHOREPLY: return "Echo Reply"; @@ -318,7 +318,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from) } else if (icmppkt->icmp_type != ICMP_ECHO) bb_error_msg("Warning: Got ICMP %d (%s)", - icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); + icmppkt->icmp_type, icmp_type_name(icmppkt->icmp_type)); fflush(stdout); } diff --git a/networking/ping6.c b/networking/ping6.c index 267109c9f..990328a51 100644 --- a/networking/ping6.c +++ b/networking/ping6.c @@ -198,7 +198,7 @@ static void sendping(int junk) pkt->icmp6_type = ICMP6_ECHO_REQUEST; pkt->icmp6_code = 0; pkt->icmp6_cksum = 0; - pkt->icmp6_seq = SWAP_BE16(ntransmitted++); + pkt->icmp6_seq = htons(ntransmitted++); pkt->icmp6_id = myid; CLR(pkt->icmp6_seq % MAX_DUP_CHK); @@ -234,7 +234,7 @@ static void sendping(int junk) #ifndef MLD_LISTENER_REDUCTION # define MLD_LISTENER_REDUCTION ICMP6_MEMBERSHIP_REDUCTION #endif -static char *icmp6_type_name (int id) +static char *icmp6_type_name(int id) { switch (id) { case ICMP6_DST_UNREACH: return "Destination Unreachable"; @@ -309,7 +309,7 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit } else if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST) bb_error_msg("Warning: Got ICMP %d (%s)", - icmppkt->icmp6_type, icmp6_type_name (icmppkt->icmp6_type)); + icmppkt->icmp6_type, icmp6_type_name(icmppkt->icmp6_type)); } static void ping(const char *host) -- 2.25.1