aboutsummaryrefslogtreecommitdiff
path: root/networking/arping.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/arping.c')
-rw-r--r--networking/arping.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/networking/arping.c b/networking/arping.c
index 7a9fbc2f4..8e457b13a 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -273,14 +273,11 @@ int arping_main(int argc, char **argv)
273 273
274 memset(&ifr, 0, sizeof(ifr)); 274 memset(&ifr, 0, sizeof(ifr));
275 strncpy(ifr.ifr_name, device, IFNAMSIZ - 1); 275 strncpy(ifr.ifr_name, device, IFNAMSIZ - 1);
276 if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) { 276 ioctl_or_perror_and_die(sock, SIOCGIFINDEX, &ifr, "interface %s not found", device);
277 bb_error_msg_and_die("interface %s not found", device);
278 }
279 ifindex = ifr.ifr_ifindex; 277 ifindex = ifr.ifr_ifindex;
280 278
281 if (ioctl(sock, SIOCGIFFLAGS, (char *) &ifr)) { 279 xioctl(sock, SIOCGIFFLAGS, (char *) &ifr);
282 bb_error_msg_and_die("SIOCGIFFLAGS"); 280
283 }
284 if (!(ifr.ifr_flags & IFF_UP)) { 281 if (!(ifr.ifr_flags & IFF_UP)) {
285 bb_error_msg_and_die("interface %s is down", device); 282 bb_error_msg_and_die("interface %s is down", device);
286 } 283 }