diff mbox

[2/2] arping: Call usage() before limiting capabilities.

Message ID 1354018775-4966-2-git-send-email-jsynacek@redhat.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Jan Synacek Nov. 27, 2012, 12:19 p.m. UTC
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(-)

Comments

YOSHIFUJI Hideaki / 吉藤英明 Nov. 28, 2012, 6:18 p.m. UTC | #1
Jan Synacek wrote:
> Otherwise, running arping binary without the capabilities set results in printing
> warnings with the usage.
> 
> Signed-off-by: Jan Synacek <jsynacek@redhat.com>

Fixed in different way.  ping/ping6 has also been fixed.
Thank you.

--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arping.c b/arping.c
index ccb68a0..02e3d9c 100644
--- a/arping.c
+++ b/arping.c
@@ -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;