mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 10:48:12 +02:00
core: avoid stale entries in the DNS manager for non-virtual devices
_dev_l3_register_l3cds() schedules a commit, but if the device has commit type NONE, that doesn't emit a l3cd-changed. Do it manually, to ensure that entries are removed from the DNS manager. Related:b86388bef3('core: avoid stale entries in the DNS manager') Fixes:58287cbcc0('core: rework IP configuration in NetworkManager using layer 3 configuration') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/995 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1268 (cherry picked from commitf8885d0724) (cherry picked from commit4baec297f4)
This commit is contained in:
parent
ce4ada62c7
commit
bc980fc07c
1 changed files with 14 additions and 1 deletions
|
|
@ -7843,7 +7843,8 @@ nm_device_slave_notify_release(NMDevice *self, NMDeviceStateReason reason)
|
||||||
void
|
void
|
||||||
nm_device_removed(NMDevice *self, gboolean unconfigure_ip_config)
|
nm_device_removed(NMDevice *self, gboolean unconfigure_ip_config)
|
||||||
{
|
{
|
||||||
NMDevicePrivate *priv;
|
NMDevicePrivate *priv;
|
||||||
|
const NML3ConfigData *l3cd_old;
|
||||||
|
|
||||||
g_return_if_fail(NM_IS_DEVICE(self));
|
g_return_if_fail(NM_IS_DEVICE(self));
|
||||||
|
|
||||||
|
|
@ -7862,6 +7863,18 @@ nm_device_removed(NMDevice *self, gboolean unconfigure_ip_config)
|
||||||
}
|
}
|
||||||
|
|
||||||
_dev_l3_register_l3cds(self, priv->l3cfg, FALSE, unconfigure_ip_config);
|
_dev_l3_register_l3cds(self, priv->l3cfg, FALSE, unconfigure_ip_config);
|
||||||
|
|
||||||
|
/* _dev_l3_register_l3cds() schedules a commit, but if the device has
|
||||||
|
* commit type NONE, that doesn't emit a l3cd-changed. Do it manually,
|
||||||
|
* to ensure that entries are removed from the DNS manager. */
|
||||||
|
if (priv->l3cfg
|
||||||
|
&& NM_IN_SET(priv->sys_iface_state,
|
||||||
|
NM_DEVICE_SYS_IFACE_STATE_REMOVED,
|
||||||
|
NM_DEVICE_SYS_IFACE_STATE_EXTERNAL)) {
|
||||||
|
l3cd_old = nm_l3cfg_get_combined_l3cd(priv->l3cfg, TRUE);
|
||||||
|
if (l3cd_old)
|
||||||
|
g_signal_emit(self, signals[L3CD_CHANGED], 0, l3cd_old, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue