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



Hi,
     I'm using NetwokManager-0.7(using dhcpcd) with wifi, and see a lot of messages like  "Received DHCP event from unexpected PID xxxx (expected xxxx)" in the syslog.
     I also see more than one dhcpcd processes running. Sometimes, only one dhcpcd process lefts at last, but sometimes not. (searching google, find the same problem someone has reported: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/255829)
     Following the source code(NM-0.7), in the function <nm_dhcp_client_start> (nm-dhcp-dhcpcd.c), it kills the previous dhcpcd process and saves the new one's pid in device->pid. But the function <dhcp_watch_cb>, knowing the termination of the previous dhcpd process, sets device->pid to zero. So the current dhcp process's pid is lost, and <nm_dhcp_manager_handle_event> will print log like "Received DHCP event from unexpected PID 8812 (expected 0)".
     Also the previous dhcpcd process's time_out handler may expire, and affects the current running dhcpcd process?

     It seems the function <supplicant_interface_acquire> (nm-device-wifi.c) registers a function <supplicant_iface_connection_state_cb> as the handler of the signal "connection-state" .
And:
<supplicant_iface_connection_state_cb> shcedules <supplicant_iface_connection_state_cb_handler>, which calls <nm_device_activate_schedule_stage3_ip_config_start>, which shcedules <nm_device_activate_stage3_ip_config_start> , which calls <real_act_stage3_ip_config_start>, which calls <nm_dhcp_manager_begin_transaction>.
So it is possiable that more than one dhcpcd processes running meanwhile.
 
    To fix this, shoud I do:
1) Protect the corresponding data struct
or
2) Add a clean step when a second dhcpcd process to be started

     Any ideas? Thanks.


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