Debian backend fixes and other issues
- From: Tom Parker <palfrey tevp net>
- To: NetworkManager-list gnome org
- Cc:
- Subject: Debian backend fixes and other issues
- Date: Thu, 09 Feb 2006 11:59:53 +0100
After a long time of not having any time to look at NetworkManager, I decided to
have another look. Tried compiling from the current CVS HEAD, and noted that the
debian backend required a number of alterations (mainly because of unused
variables, and also to remove the nm_system_device_setup_static_ip4_config item
from src/NetworkManagerSystem.h as it isn't used anywhere anymore). Patch to fix
those is attached.
However, later on while trying to compile src/nm-device-802-3-ethernet.c I got
the following. Any ideas anyone?
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -I../src/named-manager
-I../src/vpn-manager -I../src/dhcp-manager -I../utils -I../libnm-util
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -DDBUS_VERSION_MAJOR=0 -DDBUS_VERSION_MINOR=60
-DDBUS_VERSION_MICRO=0 -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
-DWPA_SUPPLICANT_BIN=\"/usr/sbin/wpa_supplicant\" -DDBUS_API_SUBJECT_TO_CHANGE
-DG_DISABLE_DEPRECATED -DBINDIR=\"/usr/local/bin\"
-DDATADIR=\"/usr/local/share\" -DSYSCONFDIR=\"/usr/local/etc\"
-DLOCALSTATEDIR=\"/usr/local/var\"
-DNM_RUN_DIR=\"/usr/local/var/run/NetworkManager\" -DARP_DEBUG -Wall -Werror
-std=gnu89 -g -O2 -Wshadow -Wmissing-declarations -Wmissing-prototypes
-Wdeclaration-after-statement -Wfloat-equal -Wno-unused-parameter
-Wno-sign-compare -MT NetworkManager-nm-device-802-3-ethernet.o -MD -MP -MF
".deps/NetworkManager-nm-device-802-3-ethernet.Tpo" -c -o
NetworkManager-nm-device-802-3-ethernet.o `test -f 'nm-device-802-3-ethernet.c'
|| echo './'`nm-device-802-3-ethernet.c; \
then mv -f ".deps/NetworkManager-nm-device-802-3-ethernet.Tpo"
".deps/NetworkManager-nm-device-802-3-ethernet.Po"; else rm -f
".deps/NetworkManager-nm-device-802-3-ethernet.Tpo"; exit 1; fi
In file included from /usr/include/linux/mii.h:12,
from nm-device-802-3-ethernet.c:364:
/usr/include/linux/if.h:95: error: redefinition of 'struct ifmap'
/usr/include/linux/if.h:131: error: redefinition of 'struct ifreq'
/usr/include/linux/if.h:181: error: redefinition of 'struct ifconf'
The /usr/include/linux/* files on my system are provided by the
linux-kernel-headers package, and I've currently got the 2.6.13+0rc3-2 version
of that installed.
Tom Parker
--
palfrey tevp net - http://tevp.net
Illegitimus non carborundum
Index: src/NetworkManagerSystem.h
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/NetworkManagerSystem.h,v
retrieving revision 1.15
diff -u -r1.15 NetworkManagerSystem.h
--- src/NetworkManagerSystem.h 23 Jan 2006 21:02:37 -0000 1.15
+++ src/NetworkManagerSystem.h 9 Feb 2006 10:48:43 -0000
@@ -46,7 +46,6 @@
void nm_system_device_flush_addresses (NMDevice *dev);
void nm_system_device_flush_addresses_with_iface (const char *iface);
-gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev);
void nm_system_enable_loopback (void);
void nm_system_flush_loopback_routes (void);
void nm_system_delete_default_route (void);
Index: src/backends/NetworkManagerDebian.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/backends/NetworkManagerDebian.c,v
retrieving revision 1.38
diff -u -r1.38 NetworkManagerDebian.c
--- src/backends/NetworkManagerDebian.c 23 Jan 2006 21:02:38 -0000 1.38
+++ src/backends/NetworkManagerDebian.c 9 Feb 2006 10:48:43 -0000
@@ -111,8 +111,6 @@
*/
void nm_system_device_flush_routes (NMDevice *dev)
{
- char *buf;
-
g_return_if_fail (dev != NULL);
/* Not really applicable for test devices */
@@ -177,117 +175,6 @@
}
/*
- * nm_system_device_setup_static_ip4_config
- *
- * Set up the device with a particular IPv4 address/netmask/gateway.
- *
- * Returns: TRUE on success
- * FALSE on error
- *
- */
-#if 0
-gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev)
-{
-#define IPBITS (sizeof (guint32) * 8)
- struct in_addr temp_addr;
- struct in_addr temp_addr2;
- char *s_tmp;
- char *s_tmp2;
- int i;
- guint32 addr;
- guint32 netmask;
- guint32 prefix = IPBITS; /* initialize with # bits in ipv4 address */
- guint32 broadcast;
- char *buf;
- int err;
- const char *iface;
-
- g_return_val_if_fail (dev != NULL, FALSE);
- g_return_val_if_fail (!nm_device_config_get_use_dhcp (dev), FALSE);
-
- addr = nm_device_config_get_ip4_address (dev);
- netmask = nm_device_config_get_ip4_netmask (dev);
- iface = nm_device_get_iface (dev);
- broadcast = nm_device_config_get_ip4_broadcast (dev);
-
- /* get the prefix from the netmask */
- for (i = 0; i < IPBITS; i++)
- {
- if (!(ntohl (netmask) & ((2 << i) - 1)))
- prefix--;
- }
-
- /* Calculate the broadcast address if the user didn't specify one */
- if (!broadcast)
- broadcast = ((addr & (int)netmask) | ~(int)netmask);
-
- /*
- * Try and work out if someone else has our IP
- * using RFC 2131 Duplicate Address Detection
- */
- temp_addr.s_addr = addr;
- buf = g_strdup_printf ("%s -q -D -c 1 -I %s %s",ARPING,
- iface, inet_ntoa (temp_addr));
- if ((err = nm_spawn_process (buf)))
- {
- nm_warning ("Error: Duplicate address '%s' detected for "
- "device '%s' \n", iface, inet_ntoa (temp_addr));
- goto error;
- }
- g_free (buf);
-
- /* set our IP address */
- temp_addr.s_addr = addr;
- temp_addr2.s_addr = broadcast;
- s_tmp = g_strdup (inet_ntoa (temp_addr));
- s_tmp2 = g_strdup (inet_ntoa (temp_addr2));
- buf = g_strdup_printf ("/sbin/ip addr add %s/%d brd %s dev %s label %s",
- s_tmp, prefix, s_tmp2, iface, iface);
- g_free (s_tmp);
- g_free (s_tmp2);
- if ((err = nm_spawn_process (buf)))
- {
- nm_warning ("Error: could not set network configuration for "
- "device '%s' using command:\n '%s'",
- iface, buf);
- goto error;
- }
- g_free (buf);
-
- /* Alert other computers of our new address */
- temp_addr.s_addr = addr;
- buf = g_strdup_printf ("%s -q -A -c 1 -I %s %s", ARPING,iface,
- inet_ntoa (temp_addr));
- nm_spawn_process (buf);
- g_free (buf);
- g_usleep (G_USEC_PER_SEC * 2);
- buf = g_strdup_printf ("%s -q -U -c 1 -I %s %s", ARPING, iface,
- inet_ntoa (temp_addr));
- nm_spawn_process (buf);
- g_free (buf);
-
- /* set the default route to be this device's gateway */
- temp_addr.s_addr = nm_device_config_get_ip4_gateway (dev);
- buf = g_strdup_printf ("/sbin/ip route replace default via %s dev %s",
- inet_ntoa (temp_addr), iface);
- if ((err = nm_spawn_process (buf)))
- {
- nm_warning ("Error: could not set default route using "
- "command:\n '%s'", buf);
- goto error;
- }
- g_free (buf);
- return (TRUE);
-
-error:
- g_free (buf);
- nm_system_device_flush_addresses (dev);
- nm_system_device_flush_routes (dev);
- return (FALSE);
-}
-#endif
-
-/*
* nm_system_enable_loopback
*
* Bring up the loopback interface
@@ -384,7 +271,6 @@
void nm_system_device_add_ip6_link_address (NMDevice *dev)
{
char *buf;
- char *addr;
struct ether_addr hw_addr;
unsigned char eui[8];
@@ -717,11 +603,7 @@
GSList * nm_system_get_dialup_config (void)
{
const char *buf;
- if_block *curr_device;
- gboolean error = FALSE;
- GError *err;
unsigned int i = 0;
- size_t len;
GSList *list = NULL;
if_block *curr;
ifparser_init();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]