2006-07-13 Dan Williams <dcbw@redhat.com>

Patch from Timothée Lecomte <timothee.lecomte@ens.fr>
	* 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


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1879 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2006-07-13 16:40:34 +00:00
parent 64dc93d85e
commit e51cecf34b
9 changed files with 109 additions and 54 deletions

View File

@@ -1,3 +1,17 @@
2006-07-13 Dan Williams <dcbw@redhat.com>
Patch from Timothée Lecomte <timothee.lecomte@ens.fr>
* 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 <leon@asplinux.ru> 2006-07-12 Leonid Kanter <leon@asplinux.ru>
* configure.in: added ru to ALL_LINGUAS * configure.in: added ru to ALL_LINGUAS

View File

@@ -261,6 +261,19 @@ fi
AC_DEFINE_UNQUOTED(WPA_SUPPLICANT_BINARY_PATH, "$WPA_SUPPLICANT_BINARY_PATH", [Define to path of wpa_supplicant binary]) AC_DEFINE_UNQUOTED(WPA_SUPPLICANT_BINARY_PATH, "$WPA_SUPPLICANT_BINARY_PATH", [Define to path of wpa_supplicant binary])
AC_SUBST(WPA_SUPPLICANT_BINARY_PATH) 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 #### 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 ## (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) ## that's a major pain and almost nobody actually seems to care)

View File

@@ -31,6 +31,10 @@
* (C) Copyright 2004 Red Hat, Inc. * (C) Copyright 2004 Red Hat, Inc.
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
@@ -90,7 +94,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface
g_return_if_fail (iface != NULL); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove routing table entries */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */ /* 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); nm_spawn_process (buf);
g_free (buf); g_free (buf);
} }
@@ -330,7 +334,7 @@ void nm_system_flush_loopback_routes (void)
*/ */
void nm_system_delete_default_route (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) 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; eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */ /* 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[0], eui[1], eui[2], eui[3],
eui[4], eui[5], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface (dev)); eui[6], eui[7], nm_device_get_iface (dev));

View File

@@ -23,6 +23,10 @@
* (C) Copyright 2004 Red Hat, Inc. * (C) Copyright 2004 Red Hat, Inc.
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
@@ -79,7 +83,7 @@ void nm_system_device_add_default_route_via_device_with_iface (const char *iface
g_return_if_fail (iface != NULL); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove routing table entries */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */ /* 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); nm_spawn_process (buf);
g_free (buf); g_free (buf);
} }
@@ -207,7 +211,7 @@ void nm_system_flush_loopback_routes (void)
*/ */
void nm_system_delete_default_route (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) 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; eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */ /* 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[0], eui[1], eui[2], eui[3],
eui[4], eui[5], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface (dev)); eui[6], eui[7], nm_device_get_iface (dev));

View File

@@ -23,6 +23,10 @@
* (C) Copyright 2004 Robert Paskowitz * (C) Copyright 2004 Robert Paskowitz
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
@@ -77,7 +81,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface)
g_return_if_fail (iface != NULL); g_return_if_fail (iface != NULL);
/* Remove routing table entries */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (buf); g_free (buf);
} }
@@ -195,7 +199,7 @@ void nm_system_flush_loopback_routes (void)
*/ */
void nm_system_delete_default_route (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) 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; eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */ /* 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[0], eui[1], eui[2], eui[3], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface(dev)); eui[6], eui[7], nm_device_get_iface(dev));
nm_spawn_process(buf); 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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (buf); g_free (buf);
} }

View File

@@ -22,6 +22,10 @@
* (C) Copyright 2006 Jürg Billeter * (C) Copyright 2006 Jürg Billeter
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
@@ -75,7 +79,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface)
g_return_if_fail (iface != NULL); g_return_if_fail (iface != NULL);
/* Remove routing table entries */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */ /* 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); nm_spawn_process (buf);
g_free (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) void nm_system_enable_loopback (void)
{ {
nm_system_device_set_up_down_with_iface ("lo", TRUE); 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) 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) 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; eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */ /* 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[0], eui[1], eui[2], eui[3], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface (dev)); eui[6], eui[7], nm_device_get_iface (dev));
nm_spawn_process (buf); nm_spawn_process (buf);

View File

@@ -19,6 +19,10 @@
* (C) Copyright 2004 Red Hat, Inc. * (C) Copyright 2004 Red Hat, Inc.
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
@@ -76,7 +80,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface)
g_return_if_fail (iface != NULL); g_return_if_fail (iface != NULL);
/* Remove routing table entries */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */ /* 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); nm_spawn_process (buf);
g_free (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) void nm_system_enable_loopback (void)
{ {
nm_system_device_set_up_down_with_iface ("lo", TRUE); 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) 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) 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; eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */ /* 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[0], eui[1], eui[2], eui[3], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface (dev)); eui[6], eui[7], nm_device_get_iface (dev));
nm_spawn_process (buf); nm_spawn_process (buf);

View File

@@ -20,6 +20,10 @@
* (C) Copyright 2004 Narayan Newton * (C) Copyright 2004 Narayan Newton
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
@@ -75,7 +79,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface)
g_return_if_fail (iface != NULL); g_return_if_fail (iface != NULL);
/* Remove routing table entries */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */ /* 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); nm_spawn_process (buf);
g_free (buf); g_free (buf);
} }
@@ -165,8 +169,8 @@ gboolean nm_system_device_has_active_routes (NMDevice *dev)
*/ */
void nm_system_enable_loopback (void) void nm_system_enable_loopback (void)
{ {
nm_spawn_process ("/sbin/ip link set dev lo up"); 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 label loopback"); 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) 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; eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */ /* 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[0], eui[1], eui[2], eui[3], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface (dev)); eui[6], eui[7], nm_device_get_iface (dev));
nm_spawn_process (buf); 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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (buf); g_free (buf);
} }
@@ -324,7 +328,7 @@ void nm_system_flush_loopback_routes (void)
*/ */
void nm_system_flush_arp_cache (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) void nm_system_deactivate_all_dialup (GSList *list)

View File

@@ -23,6 +23,10 @@
* (C) Copyright 2005-2006 SuSE GmbH * (C) Copyright 2005-2006 SuSE GmbH
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
@@ -94,7 +98,7 @@ void nm_system_device_flush_routes_with_iface (const char *iface)
g_return_if_fail (iface != NULL); g_return_if_fail (iface != NULL);
/* Remove routing table entries */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Add default gateway */ /* 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); nm_spawn_process (buf);
g_free (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); g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */ /* 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); nm_spawn_process (buf);
g_free (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) void nm_system_enable_loopback (void)
{ {
nm_system_device_set_up_down_with_iface ("lo", TRUE); 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) 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) 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; eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */ /* 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[0], eui[1], eui[2], eui[3], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface (dev)); eui[6], eui[7], nm_device_get_iface (dev));
nm_spawn_process (buf); nm_spawn_process (buf);