After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743368 - renew addresses for active DHCP connections when carrier turns on
renew addresses for active DHCP connections when carrier turns on
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-22 18:18 UTC by Thomas Haller
Modified: 2015-06-26 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Haller 2015-01-22 18:18:45 UTC
Devices that are "ignore-carrier" still don't allow to activate a DHCP connection without having carrier -- which is correct.

But when loosing carrier, the connection stays up -- which is probably correct too, even for DHCP.

When carrier returns, NM does not try to renew the addresses -- wrong.



Also TODO: check correct behavior if the lease expires while being unplugged. Correct behavior might be to tear down the connection.
Comment 1 Jiri Klimes 2015-06-26 07:12:09 UTC
(In reply to Thomas Haller from comment #0)
> Devices that are "ignore-carrier" still don't allow to activate a DHCP
> connection without having carrier -- which is correct.
> 
> But when loosing carrier, the connection stays up -- which is probably
> correct too, even for DHCP.

Agreed.

> 
> When carrier returns, NM does not try to renew the addresses -- wrong.
> 

Fixed, published in  branch jk/renew-dhcp-bgo743368.

> 
> Also TODO: check correct behavior if the lease expires while being
> unplugged. Correct behavior might be to tear down the connection.

Tested. The connection is correctly deactivated when the lease expired.
Comment 2 Thomas Haller 2015-06-26 12:03:08 UTC
(In reply to Jiri Klimes from comment #1)
> > Also TODO: check correct behavior if the lease expires while being
> > unplugged. Correct behavior might be to tear down the connection.
> 
> Tested. The connection is correctly deactivated when the lease expired.

yeah sounds right for now.

But thinking about having the root-fs mounted from the network, in the future we might need a way to flag connections to keep them up at all cost (and ignore DHCP expires). 




>> device: renew DHCP lease for active "ignore-carrier" devices on carrier-on (bgo #743368)
    
+    if (priv->rdisc) {
+         /* FIXME: todo */
+    }
+    if (priv->dnsmasq_manager) {
+         /* FIXME: todo */
+    }

these comments don't belong there after your change. Maybe leave update_for_ip_ifname_change() where it was, calling into update_dynamic_ip_setup()?


Other then that, LGTM
Comment 3 Jiri Klimes 2015-06-26 12:43:44 UTC
I think the comments are still relevant.

master: 348452f device: renew DHCP lease for active "ignore-carrier" devices on carrier-on (bgo #743368)
nm-1-0: 94931d4 device: renew DHCP lease for active "ignore-carrier" devices on carrier-on (bgo #743368)