[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] arping: wrong interface in error messages
From:       Alexander Korolkov <alexander.korolkov () gmail ! com>
Date:       2015-02-27 16:41:18
Message-ID: 54F09E2E.6000908 () gmail ! com
[Download RAW message or body]

Hello,

In arping, error message is formed before parsing argv. So arping always 
reports errors on "interface eth0", regardless of actual interface.

["arping.patch" (text/x-patch)]

diff --git a/networking/arping.c b/networking/arping.c
index a4421ed..356857c 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -284,7 +284,6 @@ int arping_main(int argc UNUSED_PARAM, char **argv)
 	// Need to remove SUID_NEVER from applets.h for this to work
 	//xsetuid(getuid());
 
-	err_str = xasprintf("interface %s %%s", device);
 	{
 		unsigned opt;
 		char *str_timeout;
@@ -305,6 +304,7 @@ int arping_main(int argc UNUSED_PARAM, char **argv)
 
 	xfunc_error_retval = 2;
 
+	err_str = xasprintf("interface %s %%s", device);
 	{
 		struct ifreq ifr;
 


_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic