summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-25 19:07:28 +0300
committerGitHub <noreply@github.com>2024-07-25 19:07:28 +0300
commit609f4b9c1bb7f3144a997f76e74e86bef0559b23 (patch)
tree95f59be8a80ba5350af32e47889e284cdf49411f
parent36146511fca98a5223fb035a9acde14c4b8a734b (diff)
downloadvyos-1x-609f4b9c1bb7f3144a997f76e74e86bef0559b23.tar.gz
vyos-1x-609f4b9c1bb7f3144a997f76e74e86bef0559b23.zip
system_option: T5552: Apply IPv4 and IPv6 options after reapplying sysctls by TuneD (#3863)
(cherry picked from commit 7b82e4005724683c6311fab22358746f2cca4c1b) Co-authored-by: Nataliia Solomko <natalirs1985@gmail.com>
-rw-r--r--data/config-mode-dependencies/vyos-1x.json4
-rwxr-xr-xsrc/conf_mode/system_option.py9
2 files changed, 13 insertions, 0 deletions
diff --git a/data/config-mode-dependencies/vyos-1x.json b/data/config-mode-dependencies/vyos-1x.json
index 3f381169b..ca4ceb58f 100644
--- a/data/config-mode-dependencies/vyos-1x.json
+++ b/data/config-mode-dependencies/vyos-1x.json
@@ -59,5 +59,9 @@
"wireguard": ["interfaces_wireguard"],
"wireless": ["interfaces_wireless"],
"wwan": ["interfaces_wwan"]
+ },
+ "system_option": {
+ "ip": ["system_ip"],
+ "ipv6": ["system_ipv6"]
}
}
diff --git a/src/conf_mode/system_option.py b/src/conf_mode/system_option.py
index ad4c0deae..ecc5bc045 100755
--- a/src/conf_mode/system_option.py
+++ b/src/conf_mode/system_option.py
@@ -31,6 +31,7 @@ from vyos.utils.process import cmd
from vyos.utils.process import is_systemd_service_running
from vyos.utils.network import is_addr_assigned
from vyos.utils.network import is_intf_addr_assigned
+from vyos.configdep import set_dependents, call_dependents
from vyos import ConfigError
from vyos import airbag
airbag.enable()
@@ -55,6 +56,12 @@ def get_config(config=None):
get_first_key=True,
with_recursive_defaults=True)
+ if 'performance' in options:
+ # Update IPv4 and IPv6 options after TuneD reapplies
+ # sysctl from config files
+ for protocol in ['ip', 'ipv6']:
+ set_dependents(protocol, conf)
+
return options
def verify(options):
@@ -145,6 +152,8 @@ def apply(options):
else:
cmd('systemctl stop tuned.service')
+ call_dependents()
+
# Keyboard layout - there will be always the default key inside the dict
# but we check for key existence anyway
if 'keyboard_layout' in options: