Re: NM 0.9.8 doesn't realise that DHCP worked



On Wed, 2013-02-27 at 12:28 +0100, Bastien Nocera wrote:
On Tue, 2013-02-26 at 16:52 -0500, Pavel Simerda wrote:
----- Original Message -----
From: "Bastien Nocera" <hadess hadess net>
Heya,

I'm using rawhide on my laptop, and I can get the network to work in
sporadic 30 second bursts, as NM doesn't realise that dhclient got an
IP
address:
Feb 26 13:35:16 sirocco dhclient[1177]: bound to 192.168.0.24 --
renewal in 17055 seconds.
Feb 26 13:35:59 sirocco NetworkManager[576]: <warn> (wlan0): DHCPv4
request timed out.

Looks wrong. 

Feb 26 13:35:59 sirocco NetworkManager[576]: <info> (wlan0): canceled
DHCP transaction, DHCP client pid 1177
Feb 26 13:35:59 sirocco NetworkManager[576]: <info> Activation
(wlan0) Stage 4 of 5 (IPv4 Configure Timeout) scheduled...
Feb 26 13:35:59 sirocco NetworkManager[576]: <info> Activation
(wlan0) Stage 4 of 5 (IPv4 Configure Timeout) started...
Feb 26 13:35:59 sirocco kernel: [  211.996738] wlan0:
deauthenticating from f4:ca:e5:94:aa:60 by local choice (reason=3)
Feb 26 13:35:59 sirocco NetworkManager[576]: <info> (wlan0): device
state change: ip-config -> failed (reason 'ip-config-unavailable')
[70 120 5]

Any ideas what might be causing this? I get the same problem on wired
and wireless networks.

Not really. Did you check if it isn't a selinux issue?

I have SELinux in permissive mode, it's not SELinux.

 We changed quite a lot of stuff but DHCP was always working for me.
We didn't modify the dhclient action binary for time, so it might be
theoretically somewhere in the dhcp plugin.

Btw you said the network works for you sometimes? Does that mean
dhclient sets up the address directly?

There's an IP address bound, as seen in the logs. Might be explained by
what's below.

 That would suggest it's not running NM's dhcp action script at all
but instead runs the default one.

I symlink'ed /etc/dhclient-script to /usr/sbin/dhclient-script after
seeing dhclient complain about /etc/dhclient-script being missing.

It didn't work before either, doesn't work when I remove that symlink,
doesn't work when I 

Maybe also try to killall dhclient (and NetworkManager) before you
test once again.

The machine's been rebooted a million times already. I doubt that a
killall would fix things anymore.

I've finally found the problem however.

In my /etc I had a copy of the example /etc/dhclient.conf, dating back
from the 25th July 2012 (when I debugged dhcp to find why we couldn't
connect to the GUADEC wireless network).

That file never caused a problem with older versions of NetworkManager
or dhclient but it seems that recent version of dhclient or the way it's
being called by NM makes it not be ignored anymore.

I'm pretty sure that your commit
1a7e7c9031526b0c8973965c826ad7d1b7cc22f9 is the one causing the
regression:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=1a7e7c9031526b0c8973965c826ad7d1b7cc22f9

It's basically loading anything that lies around, even if it's not
relevant for the distribution used.

Oh fun.  I suppose we should strip out any script thats specified in
that file when copying its configuration to the one that we actually
send to dhclient.  Would something like this fix it?

diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
index 8dc7902..d311d50 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
@@ -168,6 +168,10 @@ nm_dhcp_dhclient_create_config (const char *interface,
                                        continue;
                        }
 
+                       /* Ignore 'script' since we pass our own */
+                       if (g_str_has_prefix (p, "script "))
+                               continue;
+
                        /* Check for "also require" */
                        if (!strncmp (p, ALSOREQ_TAG, strlen (ALSOREQ_TAG))) {
                                in_alsoreq = TRUE;


Dan



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