mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 22:30:11 +01:00
device: don't reapply IP configuration if the ifindex is missing
Assertions will fail in ip_config_merge_and_apply() if the device doesn't have an ifindex. Reproducible with: $ nmcli connection add type ovs-bridge ifname ovs0 ipv4.method disabled ipv6.method disabled Connection 'ovs-bridge-ovs0' (1d5e794b-10ad-4b2b-aa7c-5ca7e34b0a55) successfully added $ nmcli device reapply ovs0 Error: Reapplying connection to device '(null)' (/org/freedesktop/NetworkManager/Devices/16) failed: Remote peer disconnected $ journalctl -u NetworkManager -e ... NetworkManager[73824]: nm_ip4_config_add_dependent_routes: assertion 'ifindex > 0' failed systemd[1]: NetworkManager.service: Main process exited, code=dumped, status=5/TRAP ... (cherry picked from commit6d6e1402dc) (cherry picked from commitf1d4853927)
This commit is contained in:
parent
65d37a3bfa
commit
a3ed90bdbc
1 changed files with 4 additions and 2 deletions
|
|
@ -11361,7 +11361,8 @@ nm_device_reactivate_ip4_config (NMDevice *self,
|
|||
}
|
||||
}
|
||||
|
||||
if (!ip_config_merge_and_apply (self, AF_INET, TRUE))
|
||||
if ( nm_device_get_ip_ifindex (self) > 0
|
||||
&& !ip_config_merge_and_apply (self, AF_INET, TRUE))
|
||||
_LOGW (LOGD_IP4, "Failed to reapply IPv4 configuration");
|
||||
}
|
||||
}
|
||||
|
|
@ -11434,7 +11435,8 @@ nm_device_reactivate_ip6_config (NMDevice *self,
|
|||
}
|
||||
}
|
||||
|
||||
if (!ip_config_merge_and_apply (self, AF_INET6, TRUE))
|
||||
if ( nm_device_get_ip_ifindex (self) > 0
|
||||
&& !ip_config_merge_and_apply (self, AF_INET6, TRUE))
|
||||
_LOGW (LOGD_IP4, "Failed to reapply IPv6 configuration");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue