summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsever-sever <v.gletenko@vyos.io>2021-01-12 07:49:31 +0000
committerChristian Poessinger <christian@poessinger.com>2021-01-12 17:07:46 +0100
commitbf68f26c2af3f9a6cd023d538a951a29f3c6d18e (patch)
tree3f3d0eabff671701ea3cc178133fe5ce422ec7eb
parent42c13e8d3b829d32016fb80d5935412935fd968c (diff)
downloadvyos-1x-bf68f26c2af3f9a6cd023d538a951a29f3c6d18e.tar.gz
vyos-1x-bf68f26c2af3f9a6cd023d538a951a29f3c6d18e.zip
Revert "ntp: T2944: By default do not listen port 123 on any address"
This reverts commit ca61add5e7dea828c67ea074368196025f4cb4eb. (cherry picked from commit a051c928aeb2a14250d57c8495c07474c92a8b61)
-rw-r--r--data/templates/ntp/ntp.conf.tmpl6
-rwxr-xr-xsmoketest/scripts/cli/test_system_ntp.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/data/templates/ntp/ntp.conf.tmpl b/data/templates/ntp/ntp.conf.tmpl
index 3f319c89b..2b56b53c3 100644
--- a/data/templates/ntp/ntp.conf.tmpl
+++ b/data/templates/ntp/ntp.conf.tmpl
@@ -36,10 +36,4 @@ interface ignore wildcard
{% for address in listen_address %}
interface listen {{ address }}
{% endfor %}
-interface listen 127.0.0.1
-interface listen ::1
-{% else %}
-interface ignore wildcard
-interface listen 127.0.0.1
-interface listen ::1
{% endif %}
diff --git a/smoketest/scripts/cli/test_system_ntp.py b/smoketest/scripts/cli/test_system_ntp.py
index 7d1bc144f..986c8dfb2 100755
--- a/smoketest/scripts/cli/test_system_ntp.py
+++ b/smoketest/scripts/cli/test_system_ntp.py
@@ -76,7 +76,11 @@ class TestSystemNTP(unittest.TestCase):
self.assertTrue(process_named_running(PROCESS_NAME))
def test_ntp_clients(self):
- # Test the allowed-networks statement
+ """ Test the allowed-networks statement """
+ listen_address = ['127.0.0.1', '::1']
+ for listen in listen_address:
+ self.session.set(base_path + ['listen-address', listen])
+
networks = ['192.0.2.0/24', '2001:db8:1000::/64']
for network in networks:
self.session.set(base_path + ['allow-clients', 'address', network])
@@ -102,7 +106,9 @@ class TestSystemNTP(unittest.TestCase):
# Check listen address
tmp = get_config_value('interface')
- test = ['ignore wildcard', 'listen 127.0.0.1', 'listen ::1']
+ test = ['ignore wildcard']
+ for listen in listen_address:
+ test.append(f'listen {listen}')
self.assertEqual(tmp, test)
# Check for running process