summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-09-03 15:47:55 -0500
committerDan Williams <dcbw@redhat.com>2014-09-11 12:11:57 -0500
commit005cb2fc35e2c3d343e33de05a09e53fad608dc5 (patch)
tree5568b0451a3355f550f0711006158188e7035c88 /src
parent544fc82aa722ef2a510969394c82fe88710162cd (diff)
downloadNetworkManager-005cb2fc35e2c3d343e33de05a09e53fad608dc5.tar.gz
core: search for arping binary too (bgo #734131)dcbw/helper-search
Diffstat (limited to 'src')
-rw-r--r--src/devices/nm-device.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index a519a6808d..8bcdadf518 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -4510,7 +4510,7 @@ start_sharing (NMDevice *self, NMIP4Config *config)
static void
send_arps (NMDevice *self, const char *mode_arg)
{
- const char *argv[] = { "/sbin/arping", mode_arg, "-q", "-I", nm_device_get_ip_iface (self), "-c", "1", NULL, NULL };
+ const char *argv[] = { NULL, mode_arg, "-q", "-I", nm_device_get_ip_iface (self), "-c", "1", NULL, NULL };
int ip_arg = G_N_ELEMENTS (argv) - 2;
NMConnection *connection;
NMSettingIP4Config *s_ip4;
@@ -4526,6 +4526,14 @@ send_arps (NMDevice *self, const char *mode_arg)
if (!s_ip4)
return;
num = nm_setting_ip4_config_get_num_addresses (s_ip4);
+ if (num == 0)
+ return;
+
+ argv[0] = nm_utils_find_helper ("arping", NULL, NULL);
+ if (!argv[0]) {
+ _LOGW (LOGD_DEVICE | LOGD_IP4, "arping could not be found; no ARPs will be sent");
+ return;
+ }
for (i = 0; i < num; i++) {
gs_free char *tmp_str = NULL;