mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-07 00:31:11 +00:00
device: update metered status when getting DHCP lease
The metered status can depend on the DHCP lease, as we accept the ANDROID_METERED vendor option. That means, on a DHCP update we need to re-evaluate the metered flag. This fixes a potential race, where IPv6 might succeed first and activation completes (with GUESS_NO metered flag). A subsequent DHCPv4 update requires to re-evaluate that decision. Fixes-test: @connection_metered_guess_yes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1080
This commit is contained in:
parent
ecc73eb239
commit
3399e19df8
|
@ -9970,7 +9970,7 @@ _dev_ipdhcpx_notify(NMDhcpClient *client, const NMDhcpClientNotifyData *notify_d
|
|||
|
||||
if (!notify_data->lease_update.l3cd) {
|
||||
_LOGT_ipdhcp(addr_family, "lease lost");
|
||||
return;
|
||||
goto lease_update_out;
|
||||
}
|
||||
|
||||
if (notify_data->lease_update.accepted)
|
||||
|
@ -10004,6 +10004,8 @@ _dev_ipdhcpx_notify(NMDhcpClient *client, const NMDhcpClientNotifyData *notify_d
|
|||
}
|
||||
}
|
||||
|
||||
lease_update_out:
|
||||
nm_device_update_metered(self);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue