SOURCES (DEVEL): NetworkManager-pld.patch - r3588

patrys patrys at pld-linux.org
Tue Apr 22 23:59:50 CEST 2008


Author: patrys                       Date: Tue Apr 22 21:59:50 2008 GMT
Module: SOURCES                       Tag: DEVEL
---- Log message:
- r3588

---- Files affected:
SOURCES:
   NetworkManager-pld.patch (1.8.2.2 -> 1.8.2.3) 

---- Diffs:

================================================================
Index: SOURCES/NetworkManager-pld.patch
diff -u SOURCES/NetworkManager-pld.patch:1.8.2.2 SOURCES/NetworkManager-pld.patch:1.8.2.3
--- SOURCES/NetworkManager-pld.patch:1.8.2.2	Wed Dec 26 00:50:34 2007
+++ SOURCES/NetworkManager-pld.patch	Tue Apr 22 23:59:44 2008
@@ -1,61 +1,59 @@
-diff -urN NetworkManager-0.7rev3096/configure.in NetworkManager-0.7rev3096.new/configure.in
---- NetworkManager-0.7rev3096/configure.in	2007-12-25 20:29:33.000000000 +0100
-+++ NetworkManager-0.7rev3096.new/configure.in	2007-12-25 20:51:24.000000000 +0100
-@@ -57,7 +57,7 @@
+diff -urN NetworkManager-0.7rev3096/src/backends/Makefile.am NetworkManager-0.7rev3096.new/src/backends/Makefile.am
+--- NetworkManager-0.7rev3096/src/backends/Makefile.am	2007-11-20 11:06:21.000000000 +0100
++++ NetworkManager-0.7rev3096.new/src/backends/Makefile.am	2007-11-20 11:31:15.000000000 +0100
+@@ -53,6 +53,13 @@
+ libnmbackend_la_LIBADD += -lfwnetconfig -lfwutil
+ endif
+ 
++if TARGET_PLD
++libnmbackend_la_SOURCES +=	NetworkManagerPLD.c \
++				shvar.c					\
++				shvar.h
++endif
++
++
+ libnmbackend_la_LIBADD += $(DBUS_LIBS) $(GTHREAD_LIBS)
+ libnmbackend_la_CPPFLAGS =	$(DBUS_CFLAGS)				\
+ 					$(GTHREAD_CFLAGS)				\
+--- NetworkManager-0.7rev3588/configure.in.orig	2008-04-22 22:56:49.000000000 +0200
++++ NetworkManager-0.7rev3588/configure.in	2008-04-22 23:04:19.847378098 +0200
+@@ -76,7 +76,7 @@
  dnl
  AC_C_BIGENDIAN
  
--AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware or paldo]))
-+AC_ARG_WITH(distro, AC_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo or pld]))
+-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo or mandriva]))
++AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva or pld]))
  if test "z$with_distro" = "z"; then
  	AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
  	AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
-@@ -67,6 +67,7 @@
- 	AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
+@@ -87,6 +87,7 @@
  	AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
  	AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
+ 	AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
 +	AC_CHECK_FILE(/etc/pld-release,with_distro="pld")
  	if test "z$with_distro" = "z"; then
  		with_distro=`lsb_release -is`
  	fi
-@@ -78,7 +79,7 @@
+@@ -98,7 +99,7 @@
  	exit 1
  else
  	case $with_distro in
--		redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware) ;;
-+		redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|pld) ;;
+-		redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva) ;;
++		redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pld) ;;
  		*)
  			echo "Your distribution (${with_distro}) is not yet supported!  (patches welcome)"
  			exit 1
-@@ -93,6 +94,7 @@
- AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
+@@ -114,6 +115,7 @@
  AM_CONDITIONAL(TARGET_PALDO, test x"$with_distro" = xpaldo)
  AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
+ AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
 +AM_CONDITIONAL(TARGET_PLD, test x"$with_distro" = xpld)
  
- if test x"$with_distro" = xgentoo ; then
+ if test x"$with_distro" = xgentoo -o x"$with_distro" = xmandriva ; then
  	AC_ARG_WITH([mdns_provider],
-diff -urN NetworkManager-0.7rev3096/src/backends/Makefile.am NetworkManager-0.7rev3096.new/src/backends/Makefile.am
---- NetworkManager-0.7rev3096/src/backends/Makefile.am	2007-11-20 11:06:21.000000000 +0100
-+++ NetworkManager-0.7rev3096.new/src/backends/Makefile.am	2007-11-20 11:31:15.000000000 +0100
-@@ -53,6 +53,13 @@
- libnmbackend_la_LIBADD += -lfwnetconfig -lfwutil
- endif
- 
-+if TARGET_PLD
-+libnmbackend_la_SOURCES +=	NetworkManagerPLD.c \
-+				shvar.c					\
-+				shvar.h
-+endif
-+
-+
- libnmbackend_la_LIBADD += $(DBUS_LIBS) $(GTHREAD_LIBS)
- libnmbackend_la_CPPFLAGS =	$(DBUS_CFLAGS)				\
- 					$(GTHREAD_CFLAGS)				\
-diff -urN NetworkManager-0.7rev3096/src/backends/NetworkManagerPLD.c NetworkManager-0.7rev3096.new/src/backends/NetworkManagerPLD.c
 --- NetworkManager-0.7rev3096/src/backends/NetworkManagerPLD.c	1970-01-01 01:00:00.000000000 +0100
-+++ NetworkManager-0.7rev3096.new/src/backends/NetworkManagerPLD.c	2007-12-25 21:14:00.000000000 +0100
-@@ -0,0 +1,579 @@
++++ NetworkManager-0.7rev3588/src/backends/NetworkManagerPLD.c	2008-04-22 23:49:54.422378684 +0200
+@@ -0,0 +1,267 @@
 +/* NetworkManager -- Network link manager
 + *
 + * Narayan Newton <narayan_newton at yahoo.com>
@@ -89,6 +87,9 @@
 +#include <sys/types.h>
 +#include <signal.h>
 +#include <arpa/inet.h>
++#include <string.h>
++#include <stdlib.h>
++
 +#include "NetworkManagerGeneric.h"
 +#include "NetworkManagerSystem.h"
 +#include "NetworkManagerUtils.h"
@@ -96,7 +97,6 @@
 +#include "nm-device-802-3-ethernet.h"
 +#include "nm-device-802-11-wireless.h"
 +#include "nm-utils.h"
-+
 +#include "shvar.h"
 +
 +/*
@@ -110,50 +110,46 @@
 +	nm_generic_init ();
 +}
 +
++
 +/*
-+ * nm_system_device_flush_routes
++ * nm_system_device_flush_ip4_routes
 + *
 + * Flush all routes associated with a network device
 + *
 + */
-+void nm_system_device_flush_routes (NMDevice *dev)
++void nm_system_device_flush_ip4_routes (NMDevice *dev)
 +{
-+	nm_generic_device_flush_routes (dev);
++	nm_generic_device_flush_ip4_routes (dev);
 +}
 +
++
 +/*
-+ * nm_system_device_flush_routes_with_iface
++ * nm_system_device_flush_ip4_routes_with_iface
 + *
 + * Flush all routes associated with a network device
 + *
 + */
-+void nm_system_device_flush_routes_with_iface (const char *iface)
++void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 +{
-+	nm_generic_device_flush_routes_with_iface (iface);
++	nm_generic_device_flush_ip4_routes_with_iface (iface);
 +}
 +
-+/*
-+ * nm_system_device_add_default_route_via_device
-+ *
-+ * Add default route to the given device
-+ *
-+ */
-+void nm_system_device_add_default_route_via_device (NMDevice *dev)
-+{
-+	nm_generic_device_add_default_route_via_device (dev);
-+}
 +
 +/*
-+ * nm_system_device_add_default_route_via_device_with_iface
++ * nm_system_device_replace_default_route
 + *
 + * Add default route to the given device
 + *
 + */
-+void nm_system_device_add_default_route_via_device_with_iface (const char *iface)
++void
++nm_system_device_replace_default_route (const char *iface,
++                                        guint32 gw,
++                                        guint32 mss)
 +{
-+	nm_generic_device_add_default_route_via_device_with_iface (iface);
++	nm_generic_device_replace_default_route (iface, gw, mss);
 +}
 +
++
 +/*
 + * nm_system_device_add_route_via_device_with_iface
 + *
@@ -165,6 +161,7 @@
 +	nm_generic_device_add_route_via_device_with_iface (iface, route);
 +}
 +
++
 +/*
 + * nm_system_device_has_active_routes
 + *
@@ -177,28 +174,31 @@
 +	return FALSE;
 +}
 +
++
 +/*
-+ * nm_system_device_flush_addresses
++ * nm_system_device_flush_ip4_addresses
 + *
 + * Flush all network addresses associated with a network device
 + *
 + */
-+void nm_system_device_flush_addresses (NMDevice *dev)
++void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 +{
-+	nm_generic_device_flush_addresses (dev);
++	nm_generic_device_flush_ip4_addresses (dev);
 +}
 +
++
 +/*
-+ * nm_system_device_flush_addresses_with_iface
++ * nm_system_device_flush_ip4_addresses_with_iface
 + *
 + * Flush all network addresses associated with a network device
 + *
 + */
-+void nm_system_device_flush_addresses_with_iface (const char *iface)
++void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 +{
-+	nm_generic_device_flush_addresses_with_iface (iface);
++	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 +}
 +
++
 +/*
 + * nm_system_enable_loopback
 + *
@@ -210,6 +210,7 @@
 +	nm_generic_enable_loopback ();
 +}
 +
++
 +/*
 + * nm_system_flush_loopback_routes
 + *
@@ -222,16 +223,6 @@
 +	nm_generic_flush_loopback_routes ();
 +}
 +
-+/*
-+ * nm_system_delete_default_route
-+ *
-+ * Remove the old default route in preparation for a new one
-+ *
-+ */
-+void nm_system_delete_default_route (void)
-+{
-+	nm_generic_delete_default_route ();
-+}
 +
 +/*
 + * nm_system_flush_arp_cache
@@ -244,6 +235,7 @@
 +	nm_generic_flush_arp_cache ();
 +}
 +
++
 +/*
 + * nm_system_kill_all_dhcp_daemons
 + *
@@ -255,6 +247,7 @@
 +	nm_spawn_process ("/bin/killall -q dhclient");
 +}
 +
++
 +/*
 + * nm_system_update_dns
 + *
@@ -267,6 +260,7 @@
 +	/* Not implemented */
 +}
 +
++
 +/*
 + * nm_system_restart_mdns_responder
 + *
@@ -279,311 +273,14 @@
 +	/* Not implemented */
 +}
 +
-+/*
-+ * nm_system_device_add_ip6_link_address
-+ *
-+ * Add a default link-local IPv6 address to a device.
-+ *
-+ */
-+void nm_system_device_add_ip6_link_address (NMDevice *dev)
-+{
-+	nm_generic_device_add_ip6_link_address (dev);
-+}
 +
 +typedef struct PLDSystemConfigData
 +{
-+	NMIP4Config	*config;
++	NMIP4Config *	config;
 +	gboolean	use_dhcp;
++	gboolean	system_disabled;
 +} PLDSystemConfigData;
 +
-+/*
-+ * nm_system_device_get_system_config
-+ *
-+ * Retrieve any relevant configuration info for a particular device
-+ * from the system network configuration information.  Clear out existing
-+ * info before setting stuff too.
-+ *
-+ */
-+void *nm_system_device_get_system_config (NMDevice *dev)
-+{
-+	char			*cfg_file_path = NULL;
-+	shvarFile		*file, *gateway_file;
-+	char			*buf = NULL;
-+	int			i, ip[4], prefix;
-+	PLDSystemConfigData	*sys_data = NULL;
-+	gboolean		error = FALSE;
-+
-+	g_return_val_if_fail (dev != NULL, NULL);
-+
-+	/* PLD stores this information in
-+	 * /etc/sysconfig/interfaces/ifcfg-* where * is the interface
-+	 * name.
-+	 */
-+
-+	sys_data = g_malloc0 (sizeof (PLDSystemConfigData));
-+	sys_data->use_dhcp = TRUE;
-+	
-+	nm_debug("SYS: dev %s", nm_device_get_iface(dev));
-+	
-+	cfg_file_path = g_strdup_printf (SYSCONFDIR"/sysconfig/interfaces/ifcfg-%s", nm_device_get_iface (dev));
-+	if (!cfg_file_path)
-+		return sys_data;
-+
-+	if (!(file = svNewFile (cfg_file_path)))
-+	{
-+		g_free (cfg_file_path);
-+		return sys_data;
-+	}
-+	g_free (cfg_file_path);
-+
-+	/* Make sure this config file is for this device */
-+	buf = svGetValue (file, "DEVICE");
-+	if (!buf || strcmp (buf, nm_device_get_iface (dev)))
-+	{
-+		free (buf);
-+		goto out;
-+	}
-+
-+	if ((buf = svGetValue (file, "BOOTPROTO")))
-+	{
-+		if (strcasecmp (buf, "dhcp"))
-+			sys_data->use_dhcp = FALSE;
-+		free (buf);
-+	}
-+
-+	sys_data->config = nm_ip4_config_new ();
-+
-+	if (!(sys_data->use_dhcp))
-+	{
-+		if ((buf = svGetValue (file, "IPADDR")))
-+		{
-+			sscanf (buf, "%d.%d.%d.%d/%d", &ip[0], &ip[1], &ip[2], &ip[3], &prefix); 
-+			sprintf (buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
-+			nm_ip4_config_set_address (sys_data->config, inet_addr (buf));
-+			
-+			if (prefix >= 0 && prefix <= 32)
-+			{
-+				for (i = 0; i <= 3; i++)
-+				{
-+					switch (prefix)
-+					{
-+						case 7:
-+							ip[i] = 254;
-+							break;
-+						case 6:
-+							ip[i] = 252;
-+							break;
-+						case 5:
-+							ip[i] = 248;
-+							break;
-+						case 4:
-+							ip[i] = 240;
-+							break;
-+						case 3:
-+							ip[i] = 224;
-+							break;
-+						case 2:
-+							ip[i] = 192;
-+							break;
-+						case 1:
-+							ip[i] = 128;
-+							break;
-+						default:
-+							if (prefix >= 8)
-+							{
-+								ip[i] = 255;
-+							}
-+							else
-+							{
-+								ip[i] = 0;
-+							}
-+					}
-+					prefix = prefix - 8;
-+				}
-+				sprintf (buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
-+				nm_ip4_config_set_netmask (sys_data->config, inet_addr (buf));
-+				free (buf);
-+			}
-+			else
-+			{
-+				guint32 addr = nm_ip4_config_get_address (sys_data->config);
-+
-+				nm_warning ("Prefix for device '%s' was invalid (should be between 0 and 32). " 
-+						"Try to make default. ", nm_device_get_iface (dev));
-+
-+
-+				if (((ntohl (addr) & 0xFF000000) >> 24) <= 127)
-+					nm_ip4_config_set_netmask (sys_data->config, htonl (0xFF000000));
-+				else if (((ntohl (addr) & 0xFF000000) >> 24) <= 191)
-+					nm_ip4_config_set_netmask (sys_data->config, htonl (0xFFFF0000));
-+				else
-+				        nm_ip4_config_set_netmask (sys_data->config, htonl (0xFFFFFF00));
-+			}
-+		}
-+		else
-+		{
-+			nm_warning ("Network configuration for device '%s' was invalid (non-DHCP configuration, "
-+						"but no IP address specified.  Will use DHCP instead.", nm_device_get_iface (dev));
-+			error = TRUE;
-+			goto out;
-+		}
-+		
-+		gateway_file = svNewFile (SYSCONFDIR"/sysconfig/network");
-+		
-+		if (gateway_file)
-+		{
-+			buf = svGetValue (gateway_file, "GATEWAYDEV");
-+			
-+			/* Make sure that GATEWAY is set for this device */
-+			if (!buf || strcmp (buf, nm_device_get_iface (dev)))
-+			{
-+				nm_warning ("Network configuration for device '%s' was invalid (non-DHCP configuration, "
-+					    "but no gateway specified - GATEWAYDEV set for other device or unset). Will "
-+					    "use DHCP instead.", nm_device_get_iface (dev));
-+				
-+				free (buf);
-+				svCloseFile (gateway_file);
-+				error = TRUE;
-+				goto out;
-+			}
-+			
-+			if ((buf = svGetValue (gateway_file, "GATEWAY")))
-+			{			
-+				nm_ip4_config_set_gateway (sys_data->config, inet_addr (buf));
-+				free (buf);
-+				svCloseFile (gateway_file);
-+			}
-+			else
-+			{
-+				nm_warning ("Network configuration for device '%s' was invalid (non-DHCP configuration, "
-+						"but no gateway specified.  Will use DHCP instead.", nm_device_get_iface (dev));
-+				svCloseFile (gateway_file);
-+				error = TRUE;
-+				goto out;
-+			}
-+		}
-+
-+		if ((buf = svGetValue (file, "BROADCAST")))
-+		{
-+			nm_ip4_config_set_broadcast (sys_data->config, inet_addr (buf));
-+			free (buf);
-+		}
-+		else
-+		{
-+			guint32 broadcast = ((nm_ip4_config_get_address (sys_data->config) & nm_ip4_config_get_netmask (sys_data->config))
-+									| ~nm_ip4_config_get_netmask (sys_data->config));
-+			nm_ip4_config_set_broadcast (sys_data->config, broadcast);
-+		}
-+	}
-+
-+	/* If we're using Static IP, grab DNS servers from the config file */
-+	if (!sys_data->use_dhcp)
-+	{
-+		nm_generic_set_ip4_config_from_resolv_conf (SYSCONFDIR"/resolv.conf", sys_data->config);
-+	}
-+
-+out:
-+	svCloseFile (file);
-+	
-+	if (error)
-+	{
-+		sys_data->use_dhcp = TRUE;
-+		/* Clear out the config */
-+		g_object_unref (sys_data->config);
-+		sys_data->config = NULL;
-+	}
-+
-+	return (void *)sys_data;
-+}
-+
-+/*
-+ * nm_system_device_free_system_config
-+ *
-+ * Free stored system config data
-+ *
-+ */
-+void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data)
-+{
-+	PLDSystemConfigData *sys_data = (PLDSystemConfigData *)system_config_data;
-+	
-+	g_return_if_fail (dev != NULL);
-+	    
-+	if (!sys_data)
-+		return;
-+	
-+	if (sys_data->config)
-+		g_object_unref (sys_data->config);
-+}
-+
-+/*
-+ * nm_system_device_get_use_dhcp
-+ *
-+ * Return whether the distro-specific system config tells us to use
-+ * dhcp for this device.
-+ *
-+ */
-+gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-+{
-+	PLDSystemConfigData	*sys_data;
-+	
-+	g_return_val_if_fail (dev != NULL, TRUE);
-+	
-+	if ((sys_data = nm_device_get_system_config_data (dev)))
-+		return sys_data->use_dhcp;
-+		    
-+	return TRUE;
-+}
-+
-+/*
-+ * nm_system_device_get_disabled
-+ *
-+ * Return whether the distro-specific system config tells us to use
-+ * dhcp for this device.
-+ *
-+ */
-+gboolean nm_system_device_get_disabled (NMDevice *dev)
-+{
-+	return FALSE;
-+}
-+
-+NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-+{
-+	PLDSystemConfigData	*sys_data;
-+	NMIP4Config		*new_config = NULL;
-+	    
-+	g_return_val_if_fail (dev != NULL, NULL);
-+		
-+	if ((sys_data = nm_device_get_system_config_data (dev)))
-+		new_config = nm_ip4_config_copy (sys_data->config);
-+			    
-+	return new_config;
-+}
-+
-+void nm_system_deactivate_all_dialup (GSList *list)
-+{
-+}
-+
-+gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-+{
-+	return FALSE;
-+}
-+
-+gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-+{
-+	return FALSE;
-+}
-+
-+/*
-+ * nm_system_get_dialup_config
-+ *
-+ * Enumerate dial up options on this system, allocate NMDialUpConfig's,
-+ * fill them out, and return.
-+ *
-+ */
-+GSList * nm_system_get_dialup_config (void)
-+{
-+	return NULL;
-+}
 +
 +/*
 + * nm_system_activate_nis
@@ -624,14 +321,3 @@
 +{
 +	return TRUE;
 +}
-+
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/NetworkManager-pld.patch?r1=1.8.2.2&r2=1.8.2.3&f=u



More information about the pld-cvs-commit mailing list