2008-03-09 Dan Williams <dcbw@redhat.com>

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



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3401 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-03-09 05:10:22 +00:00
parent 4c1821c4b0
commit f6c98a9d80
2 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2008-03-09 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (dhclient_run): send interface-specific config files to dhclient
2008-03-07 Dan Williams <dcbw@redhat.com>
* system-settings/plugins/ifcfg-fedora/parser.c

View file

@ -601,6 +601,7 @@ dhclient_run (NMDHCPDevice *device)
GError * error = NULL;
char * pidfile = NULL;
char * leasefile = NULL;
char * conffile = NULL;
gboolean success = FALSE;
char * pid_contents = NULL;
@ -629,6 +630,12 @@ dhclient_run (NMDHCPDevice *device)
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 @@ dhclient_run (NMDHCPDevice *device)
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 @@ dhclient_run (NMDHCPDevice *device)
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 @@ dhclient_run (NMDHCPDevice *device)
out:
g_free (pid_contents);
g_free (conffile);
g_free (leasefile);
g_free (pidfile);
g_ptr_array_free (dhclient_argv, TRUE);