zcip: fix unaligned trap on ARM
[oweals/busybox.git] / networking / arping.c
index 7a9fbc2f447a0907fc422644cfe0736947aaef80..a2c4c22472f598882eefb444d93459a11346e004 100644 (file)
@@ -249,7 +249,7 @@ int arping_main(int argc, char **argv)
                 * Advert also sets unsolicited.
                 */
                opt_complementary = "=1:Df:AU";
-               opt = getopt32(argc, argv, "DUAqfbc:w:I:s:",
+               opt = getopt32(argv, "DUAqfbc:w:I:s:",
                                &str_count, &str_timeout, &device, &source);
                if (opt & 0x40) /* -c: count */
                        count = xatou(str_count);
@@ -273,14 +273,11 @@ int arping_main(int argc, char **argv)
 
                memset(&ifr, 0, sizeof(ifr));
                strncpy(ifr.ifr_name, device, IFNAMSIZ - 1);
-               if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) {
-                       bb_error_msg_and_die("interface %s not found", device);
-               }
+               ioctl_or_perror_and_die(sock, SIOCGIFINDEX, &ifr, "interface %s not found", device);
                ifindex = ifr.ifr_ifindex;
 
-               if (ioctl(sock, SIOCGIFFLAGS, (char *) &ifr)) {
-                       bb_error_msg_and_die("SIOCGIFFLAGS");
-               }
+               xioctl(sock, SIOCGIFFLAGS, (char *) &ifr);
+
                if (!(ifr.ifr_flags & IFF_UP)) {
                        bb_error_msg_and_die("interface %s is down", device);
                }