GNOME Bugzilla – Bug 764398
DHCP leases do not get renewed for bond devices after resume
Last modified: 2016-03-31 14:54:37 UTC
Created attachment 325060 [details] [review] Proposed patch to fix the problem My laptop has a bond connection and it looses ip configuration sometime after going through suspend/resume circle. I was able to track down that it happens when DHCP lease completely expires. Things get even worse if I try to connect to VPN after resume - interface looses ipv4 address right after connection is established and never recovers without manual intervention. I was not able to track down exact cause of VPN dropping connection but proposed patch fixes both problems. And overall I think it makes sense: when resume happens DHCP leases should be checked/renewed because box may have been down long enough for them to be no longer valid. This is not a problem for 'hardware' connections because they are brought up and down during suspend/resume process. Software devices are not subject to this process so I guess the need special handling. I'll attach a patch that fixes problem fir me.
(In reply to Nikolay Martynov from comment #0) > Created attachment 325060 [details] [review] [review] > Proposed patch to fix the problem > And overall I think it makes sense: when resume happens DHCP leases should > be checked/renewed because box may have been down long enough for them to be > no longer valid. This is not a problem for 'hardware' connections because > they are brought up and down during suspend/resume process. Software devices > are not subject to this process so I guess the need special handling. The patch looks good to me.
Created attachment 325086 [details] [review] device: renew dhcp leases on awake for software devices This makes sure that devices like bond get their dhcp renewed Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> [thaller@redhat.com: original patch modified to rename now-public function update_dynamic_ip_setup()]
(In reply to Thomas Haller from comment #2) > Created attachment 325086 [details] [review] [review] looks right to me too -- with the attached style update.
See also https://bugzilla.redhat.com/show_bug.cgi?id=1320418
Looks good to me too. Alternatively, we could make the devices watch for manager's sleeping property change; but this will do too.
merged to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=28e9ec499a7517f35cc5093e9b545302094e55d4
... and to nm-1-0: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-1-0&id=5476ea5c452a67c0ec12a94d26a1e8321c6a1b6b