aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/arping.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-11-29 19:07:08 -0600
committerRob Landley <rob@landley.net>2014-11-29 19:07:08 -0600
commit7701bf9a35cf92e6bc6cf77bf28076c1d8181da9 (patch)
treef569d63995e134dd81b1ab376b553947236e7dd3 /toys/pending/arping.c
parentc3657fd41199ca97b74e66e80734f5c4a9509da4 (diff)
downloadtoybox-7701bf9a35cf92e6bc6cf77bf28076c1d8181da9.tar.gz
Minor whitespace cleanups.
Diffstat (limited to 'toys/pending/arping.c')
-rw-r--r--toys/pending/arping.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toys/pending/arping.c b/toys/pending/arping.c
index fe5c76ba..bc1fa5e1 100644
--- a/toys/pending/arping.c
+++ b/toys/pending/arping.c
@@ -116,18 +116,18 @@ static void send_packet()
ptr = mempcpy(ptr, &src_pk.sll_addr, src_pk.sll_halen);
ptr = mempcpy(ptr, &src_addr, 4);
- if (toys.optflags & FLAG_A)
- ptr = mempcpy(ptr, &src_pk.sll_addr, src_pk.sll_halen);
- else ptr = mempcpy(ptr, &dst_pk.sll_addr, src_pk.sll_halen);
-
+ ptr = mempcpy(ptr,
+ (toys.optflags & FLAG_A) ? &src_pk.sll_addr : &dst_pk.sll_addr,
+ src_pk.sll_halen);
ptr = mempcpy(ptr, &dest_addr, 4);
+
ret = sendto(TT.sockfd, sbuf, ptr - sbuf, 0,
(struct sockaddr *)&dst_pk, sizeof(dst_pk));
if (ret == ptr - sbuf) {
struct timeval tval;
gettimeofday(&tval, NULL);
- TT.sent_at = (tval.tv_sec * 1000000ULL + (tval.tv_usec));
+ TT.sent_at = tval.tv_sec * 1000000ULL + tval.tv_usec;
TT.sent_nr++;
if (!TT.unicast_flag) TT.brd_sent++;
}