Re: network-manager 0.8.1-beta2 does not work with isc dhcp-clients 3.1.3 and 4.1.1



Many thanks to Waldemar Brodkorb for the nice idea to get the used
commandline options.

The full call to dhclient looks like this on my system:

/sbin/dhclient -d -4 -sf /usr/lib/NetworkManager/nm-dhcp-client.action
-pf /var/run/dhclient-eth0.pid
-lf /var/lib/dhcp3/dhclient-5ef60aca-3b6e-4dd1-9523-4ae039288431-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0

The problem is caused by the "-4" parameter of the call.

The attached patch fixes it for me, but i do not know if this might
cause side effects on systems where the -4 option of dhclient 
is available.


Regards,
Thomas

-- 
Thomas Schmidt, Debian VDR Team
http://pkg-vdr-dvb.alioth.debian.org/
diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c
index d7a6e32..518254f 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient.c
@@ -490,7 +490,6 @@ dhclient_start (NMDHCPClient *client,
 	guint log_domain;
 
 	g_return_val_if_fail (priv->pid_file == NULL, -1);
-	g_return_val_if_fail (ip_opt != NULL, -1);
 
 	iface = nm_dhcp_client_get_iface (client);
 	uuid = nm_dhcp_client_get_uuid (client);
@@ -527,7 +526,9 @@ dhclient_start (NMDHCPClient *client,
 
 	g_ptr_array_add (argv, (gpointer) "-d");
 
-	g_ptr_array_add (argv, (gpointer) ip_opt);
+	if (ip_opt != NULL) {
+		g_ptr_array_add (argv, (gpointer) ip_opt);
+	}
 
 	if (mode_opt)
 		g_ptr_array_add (argv, (gpointer) mode_opt);
@@ -581,7 +582,7 @@ real_ip4_start (NMDHCPClient *client,
 		return -1;
 	}
 
-	return dhclient_start (client, "-4", NULL);
+	return dhclient_start (client, NULL, NULL);
 }
 
 static GPid

Attachment: signature.asc
Description: This is a digitally signed message part



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