NetworkManager r3401 - in trunk: . src/dhcp-manager



Author: dcbw
Date: Sun Mar  9 05:10:22 2008
New Revision: 3401
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3401&view=rev

Log:
2008-03-09  Dan Williams  <dcbw redhat com>

	* src/dhcp-manager/nm-dhcp-manager.c
		- (dhclient_run): send interface-specific config files to dhclient



Modified:
   trunk/ChangeLog
   trunk/src/dhcp-manager/nm-dhcp-manager.c

Modified: trunk/src/dhcp-manager/nm-dhcp-manager.c
==============================================================================
--- trunk/src/dhcp-manager/nm-dhcp-manager.c	(original)
+++ trunk/src/dhcp-manager/nm-dhcp-manager.c	Sun Mar  9 05:10:22 2008
@@ -601,6 +601,7 @@
 	GError *		error = NULL;
 	char *			pidfile = NULL;
 	char *			leasefile = NULL;
+	char *			conffile = NULL;
 	gboolean		success = FALSE;
 	char *			pid_contents = NULL;
 
@@ -629,6 +630,12 @@
 		goto out;
 	}
 
+	conffile = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", device->iface);
+	if (!conffile) {
+		nm_warning ("%s: not enough memory for dhclient options.", device->iface);
+		goto out;
+	}
+
 	/* Kill any existing dhclient bound to this interface */
 	if (g_file_get_contents (pidfile, &pid_contents, NULL, NULL)) {
 		unsigned long int tmp = strtoul (pid_contents, NULL, 10);
@@ -643,11 +650,6 @@
 
 	g_ptr_array_add (dhclient_argv, (gpointer) "-d");
 
-#if 0
-	/* Disable until we figure out what is really needed here */
-	g_ptr_array_add (dhclient_argv, (gpointer) "-x");
-#endif
-
 	g_ptr_array_add (dhclient_argv, (gpointer) "-sf");	/* Set script file */
 	g_ptr_array_add (dhclient_argv, (gpointer) ACTION_SCRIPT_PATH );
 
@@ -657,6 +659,9 @@
 	g_ptr_array_add (dhclient_argv, (gpointer) "-lf");	/* Set lease file */
 	g_ptr_array_add (dhclient_argv, (gpointer) leasefile);
 
+	g_ptr_array_add (dhclient_argv, (gpointer) "-cf");	/* Set interface config file */
+	g_ptr_array_add (dhclient_argv, (gpointer) conffile);
+
 	g_ptr_array_add (dhclient_argv, (gpointer) device->iface);
 	g_ptr_array_add (dhclient_argv, NULL);
 
@@ -677,6 +682,7 @@
 
 out:
 	g_free (pid_contents);
+	g_free (conffile);
 	g_free (leasefile);
 	g_free (pidfile);
 	g_ptr_array_free (dhclient_argv, TRUE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]