mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
Reject configuring ipv6 disabled if not supported in NM
In NM, the property `NM_SETTING_IP6_CONFIG_METHOD_DISABLED` is only supported since NM 1.20, therefore, the role should reject configuring `ipv6 disabled` if `NM_SETTING_IP6_CONFIG_METHOD_DISABLED` is not supported by the running version of NM. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
parent
da260c85cd
commit
59ee08ae02
5 changed files with 51 additions and 6 deletions
|
|
@ -2216,6 +2216,17 @@ class ArgValidator_ListConnections(ArgValidatorList):
|
|||
idx,
|
||||
"ip.ipv6_disabled is not supported by initscripts.",
|
||||
)
|
||||
if not hasattr(Util.NM(), "SETTING_IP6_CONFIG_METHOD_DISABLED"):
|
||||
raise ValidationError.from_connection(
|
||||
idx,
|
||||
"ip.ipv6_disabled is not supported by the running version of "
|
||||
"NetworkManager, it requires at least version 1.20. But you can "
|
||||
"disable IPv6 auto configuration by setting ip.auto6 to False. "
|
||||
"Then NetworkManager will ignore IPv6 for this connection. This "
|
||||
"will still leave the sysctl value 'disable_ipv6' unchanged, but "
|
||||
"setting ip.ipv6_disabled to True in the role will set the sysctl "
|
||||
"value 'disable_ipv6' to True ",
|
||||
)
|
||||
# Setting ip.dns is not allowed when corresponding IP method for that
|
||||
# nameserver is disabled
|
||||
for nameserver in connection["ip"]["dns"]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue