Re: About "Received DHCP event from unexpected PID xxxx (expected xxxx)"



Hi Dan,
I've reproduced this problem with the newest NM (checkout from git, master branch, commit: dc54f52fb563dc64fe3036f8afb7ef82ae1d5480) and dhcp-client 3.1.1. I enabled only one network interface--wlan0.

The result:
    1) Some DHCPClients are still living (until I kills them manually), though it reports state 15 (in function <nm_dhcp_manager_begin_transaction>)
    2) This pidfile (in function <nm_dhcp_client_start>) doesn't indicate an existing  DHCPClient(see the attachment "debug.diff"), so another DHCPClient for the same network interface is forked.

[attachements]
1) debug.diff: Adds some logging code.
2) log.gz: The log file, may be a little big, so I compressed it.
diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c
index 946be0c..625d9bc 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient.c
@@ -250,6 +250,8 @@ nm_dhcp_client_start (NMDHCPDevice *device, NMSettingIP4Config *s_ip4)
 		if (!((tmp == ULONG_MAX) && (errno == ERANGE)))
 			nm_dhcp_client_stop (device, (pid_t) tmp);
 		remove (device->pid_file);
+	}else if (device->pid) {
+		nm_debug ("Miss kill existing dhclient, pid %d", device->pid);
 	}
 
 	dhclient_argv = g_ptr_array_new ();
diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c
index b2e352d..b3d0665 100644
--- a/src/dhcp-manager/nm-dhcp-manager.c
+++ b/src/dhcp-manager/nm-dhcp-manager.c
@@ -592,6 +592,7 @@ nm_dhcp_manager_begin_transaction (NMDHCPManager *manager,
 	if (!device)
 		device = nm_dhcp_device_new (manager, iface);
 
+	nm_debug ("device->pid: %d, device->state: %d", device->pid, device->state);
 	if (device->pid && (device->state < DHC_ABEND)) {
 		/* Cancel any DHCP transaction already in progress */
 		nm_dhcp_manager_cancel_transaction_real (device);

Attachment: log.gz
Description: GNU Zip compressed data



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