diff --git a/ChangeLog b/ChangeLog index c890a80d8b..434111756f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2006-07-13 Dan Williams + + Patch from Timothée Lecomte + * configure.in + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - Convert hardcoding of 'ip' path to configure-time + detected one + 2006-07-12 Leonid Kanter * configure.in: added ru to ALL_LINGUAS diff --git a/configure.in b/configure.in index dd8b27ee89..ba35b0f508 100644 --- a/configure.in +++ b/configure.in @@ -261,6 +261,19 @@ fi AC_DEFINE_UNQUOTED(WPA_SUPPLICANT_BINARY_PATH, "$WPA_SUPPLICANT_BINARY_PATH", [Define to path of wpa_supplicant binary]) AC_SUBST(WPA_SUPPLICANT_BINARY_PATH) +# ip binary path +AC_ARG_WITH(ip, AC_HELP_STRING([--with-ip=/path/to/ip], [path to ip])) +if test "x${with_ip}" = x; then + AC_PATH_PROG(IP_BINARY_PATH, ip, [], $PATH:/sbin:/usr/sbin) + if ! test -x "$IP_BINARY_PATH"; then + AC_MSG_ERROR(iproute2 was not installed. See http://linux-net.osdl.org/index.php/Iproute2) + fi +else + IP_BINARY_PATH="$with_ip" +fi +AC_DEFINE_UNQUOTED(IP_BINARY_PATH, "$IP_BINARY_PATH", [Define to path of ip binary]) +AC_SUBST(IP_BINARY_PATH) + #### find the actual value for $prefix that we'll end up with ## (I know this is broken and should be done in the Makefile, but ## that's a major pain and almost nobody actually seems to care) diff --git a/src/backends/NetworkManagerArch.c b/src/backends/NetworkManagerArch.c index 388c78845f..3b8322ae56 100644 --- a/src/backends/NetworkManagerArch.c +++ b/src/backends/NetworkManagerArch.c @@ -31,6 +31,10 @@ * (C) Copyright 2004 Red Hat, Inc. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -90,7 +94,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/usr/sbin/ip route add default dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add default dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -108,7 +112,7 @@ void nm_system_device_add_route_via_device_with_iface (const char *iface, const g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/usr/sbin/ip route add %s dev %s", route, iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add %s dev %s", route, iface); nm_spawn_process (buf); g_free (buf); } @@ -145,7 +149,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove routing table entries */ - buf = g_strdup_printf ("/usr/sbin/ip route flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -181,7 +185,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove all IP addresses for a device */ - buf = g_strdup_printf ("/usr/sbin/ip addr flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " addr flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -330,7 +334,7 @@ void nm_system_flush_loopback_routes (void) */ void nm_system_delete_default_route (void) { - nm_spawn_process ("/usr/sbin/ip route del default"); + nm_spawn_process (IP_BINARY_PATH " route del default"); } @@ -342,7 +346,7 @@ void nm_system_delete_default_route (void) */ void nm_system_flush_arp_cache (void) { - nm_spawn_process ("/usr/sbin/ip neigh flush all"); + nm_spawn_process (IP_BINARY_PATH " neigh flush all"); } @@ -417,7 +421,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev) eui[0] ^= 2; /* Add the default link-local IPv6 address to a device */ - buf = g_strdup_printf ("/usr/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", + buf = g_strdup_printf (IP_BINARY_PATH " -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], eui[6], eui[7], nm_device_get_iface (dev)); diff --git a/src/backends/NetworkManagerDebian.c b/src/backends/NetworkManagerDebian.c index 740572a6d1..82a8ece49b 100644 --- a/src/backends/NetworkManagerDebian.c +++ b/src/backends/NetworkManagerDebian.c @@ -23,6 +23,10 @@ * (C) Copyright 2004 Red Hat, Inc. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -79,7 +83,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add default dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -97,7 +101,7 @@ void nm_system_device_add_route_via_device_with_iface (const char *iface, const g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add %s dev %s", route, iface); nm_spawn_process (buf); g_free (buf); } @@ -133,7 +137,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove routing table entries */ - buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -169,7 +173,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove all IP addresses for a device */ - buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " addr flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -207,7 +211,7 @@ void nm_system_flush_loopback_routes (void) */ void nm_system_delete_default_route (void) { - nm_spawn_process ("/sbin/ip route del default"); + nm_spawn_process (IP_BINARY_PATH " route del default"); } @@ -219,7 +223,7 @@ void nm_system_delete_default_route (void) */ void nm_system_flush_arp_cache (void) { - nm_spawn_process ("/sbin/ip neigh flush all"); + nm_spawn_process (IP_BINARY_PATH " neigh flush all"); } @@ -286,7 +290,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev) eui[0] ^= 2; /* Add the default link-local IPv6 address to a device */ - buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", + buf = g_strdup_printf (IP_BINARY_PATH " -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], eui[6], eui[7], nm_device_get_iface (dev)); diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c index 38fbc29b2a..dbfa0f0d5f 100644 --- a/src/backends/NetworkManagerGentoo.c +++ b/src/backends/NetworkManagerGentoo.c @@ -23,6 +23,10 @@ * (C) Copyright 2004 Robert Paskowitz */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -77,7 +81,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove routing table entries */ - buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -125,7 +129,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove all IP addresses for a device */ - buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " addr flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -155,7 +159,7 @@ void nm_system_device_add_route_via_device_with_iface (const char *iface, const g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add %s dev %s", route, iface); nm_spawn_process (buf); g_free (buf); } @@ -195,7 +199,7 @@ void nm_system_flush_loopback_routes (void) */ void nm_system_delete_default_route (void) { - nm_spawn_process ("/sbin/ip route del default"); + nm_spawn_process (IP_BINARY_PATH " route del default"); } /* @@ -206,7 +210,7 @@ void nm_system_delete_default_route (void) */ void nm_system_flush_arp_cache (void) { - nm_spawn_process ("/sbin/ip neigh flush all"); + nm_spawn_process (IP_BINARY_PATH " neigh flush all"); } @@ -284,7 +288,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev) eui[0] ^= 2; /* Add the default link-local IPv6 address to a device */ - buf = g_strdup_printf("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", + buf = g_strdup_printf(IP_BINARY_PATH " -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], eui[6], eui[7], nm_device_get_iface(dev)); nm_spawn_process(buf); @@ -471,7 +475,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add default dev %s", iface); nm_spawn_process (buf); g_free (buf); } diff --git a/src/backends/NetworkManagerPaldo.c b/src/backends/NetworkManagerPaldo.c index 89a7e9c6c5..1413735f31 100644 --- a/src/backends/NetworkManagerPaldo.c +++ b/src/backends/NetworkManagerPaldo.c @@ -22,6 +22,10 @@ * (C) Copyright 2006 Jürg Billeter */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -75,7 +79,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove routing table entries */ - buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -112,7 +116,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add default dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -131,7 +135,7 @@ void nm_system_device_add_route_via_device_with_iface (const char *iface, const g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add %s dev %s", route, iface); nm_spawn_process (buf); g_free (buf); } @@ -181,7 +185,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove all IP addresses for a device */ - buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " addr flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -196,7 +200,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) void nm_system_enable_loopback (void) { nm_system_device_set_up_down_with_iface ("lo", TRUE); - nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo scope host label loopback"); + nm_spawn_process (IP_BINARY_PATH " addr add 127.0.0.1/8 brd 127.255.255.255 dev lo scope host label loopback"); } @@ -221,7 +225,7 @@ void nm_system_flush_loopback_routes (void) */ void nm_system_delete_default_route (void) { - nm_spawn_process ("/sbin/ip route del default"); + nm_spawn_process (IP_BINARY_PATH " route del default"); } @@ -233,7 +237,7 @@ void nm_system_delete_default_route (void) */ void nm_system_flush_arp_cache (void) { - nm_spawn_process ("/sbin/ip neigh flush all"); + nm_spawn_process (IP_BINARY_PATH " neigh flush all"); } @@ -297,7 +301,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev) eui[0] ^= 2; /* Add the default link-local IPv6 address to a device */ - buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", + buf = g_strdup_printf (IP_BINARY_PATH " -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], eui[6], eui[7], nm_device_get_iface (dev)); nm_spawn_process (buf); diff --git a/src/backends/NetworkManagerRedHat.c b/src/backends/NetworkManagerRedHat.c index 2f7a56b622..b86854c0a1 100644 --- a/src/backends/NetworkManagerRedHat.c +++ b/src/backends/NetworkManagerRedHat.c @@ -19,6 +19,10 @@ * (C) Copyright 2004 Red Hat, Inc. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -76,7 +80,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove routing table entries */ - buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -113,7 +117,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add default dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -132,7 +136,7 @@ void nm_system_device_add_route_via_device_with_iface (const char *iface, const g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add %s dev %s", route, iface); nm_spawn_process (buf); g_free (buf); } @@ -182,7 +186,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove all IP addresses for a device */ - buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " addr flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -210,7 +214,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) void nm_system_enable_loopback (void) { nm_system_device_set_up_down_with_iface ("lo", TRUE); - nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo scope host label loopback"); + nm_spawn_process (IP_BINARY_PATH " addr add 127.0.0.1/8 brd 127.255.255.255 dev lo scope host label loopback"); } @@ -235,7 +239,7 @@ void nm_system_flush_loopback_routes (void) */ void nm_system_delete_default_route (void) { - nm_spawn_process ("/sbin/ip route del default"); + nm_spawn_process (IP_BINARY_PATH " route del default"); } @@ -247,7 +251,7 @@ void nm_system_delete_default_route (void) */ void nm_system_flush_arp_cache (void) { - nm_spawn_process ("/sbin/ip neigh flush all"); + nm_spawn_process (IP_BINARY_PATH " neigh flush all"); } @@ -332,7 +336,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev) eui[0] ^= 2; /* Add the default link-local IPv6 address to a device */ - buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", + buf = g_strdup_printf (IP_BINARY_PATH " -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], eui[6], eui[7], nm_device_get_iface (dev)); nm_spawn_process (buf); diff --git a/src/backends/NetworkManagerSlackware.c b/src/backends/NetworkManagerSlackware.c index a88227c87a..0e8536f4ea 100644 --- a/src/backends/NetworkManagerSlackware.c +++ b/src/backends/NetworkManagerSlackware.c @@ -20,6 +20,10 @@ * (C) Copyright 2004 Narayan Newton */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -75,7 +79,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove routing table entries */ - buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -111,7 +115,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove all IP addresses for a device */ - buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " addr flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -165,8 +169,8 @@ gboolean nm_system_device_has_active_routes (NMDevice *dev) */ void nm_system_enable_loopback (void) { - nm_spawn_process ("/sbin/ip link set dev lo up"); - nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo label loopback"); + nm_system_device_set_up_down_with_iface ("lo", TRUE); + nm_spawn_process (IP_BINARY_PATH " addr add 127.0.0.1/8 brd 127.255.255.255 dev lo label loopback"); } @@ -178,7 +182,7 @@ void nm_system_enable_loopback (void) */ void nm_system_delete_default_route (void) { - nm_spawn_process ("/sbin/ip route del default"); + nm_spawn_process (IP_BINARY_PATH " route del default"); } @@ -242,7 +246,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev) eui[0] ^= 2; /* Add the default link-local IPv6 address to a device */ - buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", + buf = g_strdup_printf (IP_BINARY_PATH " -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], eui[6], eui[7], nm_device_get_iface (dev)); nm_spawn_process (buf); @@ -262,7 +266,7 @@ void nm_system_device_add_route_via_device_with_iface (const char *iface, const g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add %s dev %s", route, iface); nm_spawn_process (buf); g_free (buf); } @@ -297,7 +301,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add default dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -324,7 +328,7 @@ void nm_system_flush_loopback_routes (void) */ void nm_system_flush_arp_cache (void) { - nm_spawn_process ("/sbin/ip neigh flush all"); + nm_spawn_process (IP_BINARY_PATH " neigh flush all"); } void nm_system_deactivate_all_dialup (GSList *list) diff --git a/src/backends/NetworkManagerSuSE.c b/src/backends/NetworkManagerSuSE.c index a5802f7689..005d7ed11b 100644 --- a/src/backends/NetworkManagerSuSE.c +++ b/src/backends/NetworkManagerSuSE.c @@ -23,6 +23,10 @@ * (C) Copyright 2005-2006 SuSE GmbH */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -94,7 +98,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove routing table entries */ - buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -131,7 +135,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add default dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -150,7 +154,7 @@ void nm_system_device_add_route_via_device_with_iface (const char *iface, const g_return_if_fail (iface != NULL); /* Add default gateway */ - buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface); + buf = g_strdup_printf (IP_BINARY_PATH " route add %s dev %s", route, iface); nm_spawn_process (buf); g_free (buf); } @@ -200,7 +204,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) g_return_if_fail (iface != NULL); /* Remove all IP addresses for a device */ - buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface); + buf = g_strdup_printf (IP_BINARY_PATH " addr flush dev %s", iface); nm_spawn_process (buf); g_free (buf); } @@ -215,7 +219,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface) void nm_system_enable_loopback (void) { nm_system_device_set_up_down_with_iface ("lo", TRUE); - nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo scope host label loopback"); + nm_spawn_process (IP_BINARY_PATH " addr add 127.0.0.1/8 brd 127.255.255.255 dev lo scope host label loopback"); } @@ -240,7 +244,7 @@ void nm_system_flush_loopback_routes (void) */ void nm_system_delete_default_route (void) { - nm_spawn_process ("/sbin/ip route del default"); + nm_spawn_process (IP_BINARY_PATH " route del default"); } @@ -252,7 +256,7 @@ void nm_system_delete_default_route (void) */ void nm_system_flush_arp_cache (void) { - nm_spawn_process ("/sbin/ip neigh flush all"); + nm_spawn_process (IP_BINARY_PATH " neigh flush all"); } @@ -340,7 +344,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev) eui[0] ^= 2; /* Add the default link-local IPv6 address to a device */ - buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", + buf = g_strdup_printf (IP_BINARY_PATH " -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], eui[6], eui[7], nm_device_get_iface (dev)); nm_spawn_process (buf);