@@ -959,19 +959,6 @@ main(int argc, char **argv)
int socket_errno;
int ch;
- limit_capabilities();
-
-#ifdef USE_IDN
- setlocale(LC_ALL, "");
-#endif
-
- enable_capability_raw();
-
- s = socket(PF_PACKET, SOCK_DGRAM, 0);
- socket_errno = errno;
-
- disable_capability_raw();
-
while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) {
switch(ch) {
case 'b':
@@ -1023,6 +1010,19 @@ main(int argc, char **argv)
target = *argv;
+ limit_capabilities();
+
+#ifdef USE_IDN
+ setlocale(LC_ALL, "");
+#endif
+
+ enable_capability_raw();
+
+ s = socket(PF_PACKET, SOCK_DGRAM, 0);
+ socket_errno = errno;
+
+ disable_capability_raw();
+
if (device.name && !*device.name)
device.name = NULL;
Otherwise, running arping binary without the capabilities set results in printing warnings with the usage. Signed-off-by: Jan Synacek <jsynacek@redhat.com> --- arping.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)