mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-13 15:10:29 +01:00
device: ensure tc_commit() is called only once per activation
Stage2 can be called multiple times. Ensure that tc_commit() is only called the first time. This is important now that tc synchronization requires to clear all qdiscs and recreate them.
This commit is contained in:
parent
3981bff2a0
commit
e0691f9528
1 changed files with 6 additions and 2 deletions
|
|
@ -505,6 +505,7 @@ typedef struct _NMDevicePrivate {
|
|||
NMDeviceStageState stage1_sriov_state : 3;
|
||||
|
||||
bool ip_config_started : 1;
|
||||
bool tc_committed : 1;
|
||||
|
||||
char *current_stable_id;
|
||||
|
||||
|
|
@ -8516,13 +8517,14 @@ activate_stage2_device_config(NMDevice *self)
|
|||
_ethtool_state_set(self);
|
||||
|
||||
if (!nm_device_sys_iface_state_is_external_or_assume(self)) {
|
||||
if (!tc_commit(self)) {
|
||||
_LOGW(LOGD_IP6, "failed applying traffic control rules");
|
||||
if (!priv->tc_committed && !tc_commit(self)) {
|
||||
_LOGW(LOGD_DEVICE, "failed applying traffic control rules");
|
||||
nm_device_state_changed(self,
|
||||
NM_DEVICE_STATE_FAILED,
|
||||
NM_DEVICE_STATE_REASON_CONFIG_FAILED);
|
||||
return;
|
||||
}
|
||||
priv->tc_committed = TRUE;
|
||||
}
|
||||
|
||||
_routing_rules_sync(self, NM_TERNARY_TRUE);
|
||||
|
|
@ -16056,6 +16058,8 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu
|
|||
}
|
||||
}
|
||||
|
||||
priv->tc_committed = FALSE;
|
||||
|
||||
_routing_rules_sync(self,
|
||||
cleanup_type == CLEANUP_TYPE_KEEP ? NM_TERNARY_DEFAULT : NM_TERNARY_FALSE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue