arping: fix iface name in error messages

arping: interface eth0 not found: No such device
                  ^^^^

This is because error template is formed before parsing command line arguments,
so it always uses default interface name "eth0".

Signed-off-by: Alexander Korolkov <alexander.korolkov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Alexander Korolkov 2015-03-12 13:05:33 +01:00 committed by Denys Vlasenko
parent fe8b5802ba
commit 748fb60f27

View File

@ -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 // Need to remove SUID_NEVER from applets.h for this to work
//xsetuid(getuid()); //xsetuid(getuid());
err_str = xasprintf("interface %s %%s", device);
{ {
unsigned opt; unsigned opt;
char *str_timeout; char *str_timeout;
@ -302,7 +301,7 @@ int arping_main(int argc UNUSED_PARAM, char **argv)
} }
target = argv[optind]; target = argv[optind];
err_str = xasprintf("interface %s %%s", device);
xfunc_error_retval = 2; xfunc_error_retval = 2;
{ {