mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 09:10:17 +01:00
device: use nm_l3cfg_check_ready() in _dev_ipac6_ndisc_config_changed()
Instead of open coding the check for ready addresses, use nm_l3cfg_check_ready().
This commit is contained in:
parent
5da8e0666b
commit
15d55e5a68
1 changed files with 7 additions and 20 deletions
|
|
@ -11432,10 +11432,8 @@ _dev_ipac6_ndisc_config_changed(NMNDisc *ndisc,
|
|||
const NML3ConfigData *l3cd,
|
||||
NMDevice *self)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
gboolean ready = TRUE;
|
||||
NMDedupMultiIter iter;
|
||||
const NMPObject *obj;
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
gboolean ready;
|
||||
|
||||
_dev_ipac6_grace_period_start(self, 0, TRUE);
|
||||
|
||||
|
|
@ -11446,22 +11444,11 @@ _dev_ipac6_ndisc_config_changed(NMNDisc *ndisc,
|
|||
FALSE);
|
||||
|
||||
nm_clear_l3cd(&priv->ipac6_data.l3cd);
|
||||
|
||||
/* wait that addresses are committed to platform and
|
||||
* become non-tentative before declaring AC6 is ready.*/
|
||||
nm_l3_config_data_iter_obj_for_each (&iter, l3cd, &obj, NMP_OBJECT_TYPE_IP6_ADDRESS) {
|
||||
const NMPlatformIP6Address *addr = NMP_OBJECT_CAST_IP6_ADDRESS(obj);
|
||||
const NMPlatformIP6Address *plat_addr;
|
||||
|
||||
plat_addr = nm_platform_ip6_address_get(nm_device_get_platform(self),
|
||||
nm_device_get_ip_ifindex(self),
|
||||
&addr->address);
|
||||
if (!plat_addr || (plat_addr->n_ifa_flags & IFA_F_TENTATIVE)) {
|
||||
ready = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ready = nm_l3cfg_check_ready(priv->l3cfg,
|
||||
l3cd,
|
||||
AF_INET6,
|
||||
NM_L3CFG_CHECK_READY_FLAGS_IP6_DAD_READY,
|
||||
NULL);
|
||||
if (ready) {
|
||||
_dev_ipac6_set_state(self, NM_DEVICE_IP_STATE_READY);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue