summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-10-20 07:38:49 +0200
committerGitHub <noreply@github.com>2021-10-20 07:38:49 +0200
commitf681e566775a708273b1ef0d5a7dc22978028d94 (patch)
treec04449f9864d1bd5620b8fcf333cb7d712e1a798
parente48b345f7524761a29b7adf36a13c155e2f34d15 (diff)
parent16ae2933ff976737e52113105228a5f7f75686a3 (diff)
downloadvyos-1x-f681e566775a708273b1ef0d5a7dc22978028d94.tar.gz
vyos-1x-f681e566775a708273b1ef0d5a7dc22978028d94.zip
Merge pull request #1030 from sarthurdev/mdns-avahi
mdns: T3917: Change to avahi-daemon for IPv4 + IPv6 mDNS repeater
-rw-r--r--data/templates/mdns-repeater/avahi-daemon.tmpl18
-rw-r--r--data/templates/mdns-repeater/mdns-repeater.tmpl2
-rw-r--r--debian/control2
-rwxr-xr-xsmoketest/scripts/cli/test_service_mdns-repeater.py2
-rwxr-xr-xsrc/conf_mode/service_mdns-repeater.py10
5 files changed, 25 insertions, 9 deletions
diff --git a/data/templates/mdns-repeater/avahi-daemon.tmpl b/data/templates/mdns-repeater/avahi-daemon.tmpl
new file mode 100644
index 000000000..65bb5a306
--- /dev/null
+++ b/data/templates/mdns-repeater/avahi-daemon.tmpl
@@ -0,0 +1,18 @@
+[server]
+use-ipv4=yes
+use-ipv6=yes
+allow-interfaces={{ interface | join(', ') }}
+disallow-other-stacks=no
+
+[wide-area]
+enable-wide-area=yes
+
+[publish]
+disable-publishing=yes
+disable-user-service-publishing=yes
+publish-addresses=no
+publish-hinfo=no
+publish-workstation=no
+
+[reflector]
+enable-reflector=yes
diff --git a/data/templates/mdns-repeater/mdns-repeater.tmpl b/data/templates/mdns-repeater/mdns-repeater.tmpl
deleted file mode 100644
index 80f4ab047..000000000
--- a/data/templates/mdns-repeater/mdns-repeater.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-### Autogenerated by mdns_repeater.py ###
-DAEMON_ARGS="{{ interface | join(' ') }}"
diff --git a/debian/control b/debian/control
index 6c0f2f886..0843b9025 100644
--- a/debian/control
+++ b/debian/control
@@ -33,6 +33,7 @@ Architecture: amd64 arm64
Depends:
${python3:Depends},
accel-ppp,
+ avahi-daemon,
beep,
bmon,
bsdmainutils,
@@ -87,7 +88,6 @@ Depends:
lldpd,
lm-sensors,
lsscsi,
- mdns-repeater,
minisign,
modemmanager,
mtr-tiny,
diff --git a/smoketest/scripts/cli/test_service_mdns-repeater.py b/smoketest/scripts/cli/test_service_mdns-repeater.py
index b1092c3e5..8941f065c 100755
--- a/smoketest/scripts/cli/test_service_mdns-repeater.py
+++ b/smoketest/scripts/cli/test_service_mdns-repeater.py
@@ -42,7 +42,7 @@ class TestServiceMDNSrepeater(VyOSUnitTestSHIM.TestCase):
self.cli_commit()
# Check for running process
- self.assertTrue(process_named_running('mdns-repeater'))
+ self.assertTrue(process_named_running('avahi-daemon'))
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/src/conf_mode/service_mdns-repeater.py b/src/conf_mode/service_mdns-repeater.py
index c920920ed..55b568e48 100755
--- a/src/conf_mode/service_mdns-repeater.py
+++ b/src/conf_mode/service_mdns-repeater.py
@@ -28,7 +28,7 @@ from vyos import ConfigError
from vyos import airbag
airbag.enable()
-config_file = r'/etc/default/mdns-repeater'
+config_file = '/etc/avahi/avahi-daemon.conf'
vrrp_running_file = '/run/mdns_vrrp_active'
def get_config(config=None):
@@ -92,12 +92,12 @@ def generate(mdns):
if len(mdns['interface']) < 2:
return None
- render(config_file, 'mdns-repeater/mdns-repeater.tmpl', mdns)
+ render(config_file, 'mdns-repeater/avahi-daemon.tmpl', mdns)
return None
def apply(mdns):
if not mdns or 'disable' in mdns:
- call('systemctl stop mdns-repeater.service')
+ call('systemctl stop avahi-daemon.service')
if os.path.exists(config_file):
os.unlink(config_file)
@@ -112,10 +112,10 @@ def apply(mdns):
os.mknod(vrrp_running_file) # vrrp script looks for this file to update mdns repeater
if len(mdns['interface']) < 2:
- call('systemctl stop mdns-repeater.service')
+ call('systemctl stop avahi-daemon.service')
return None
- call('systemctl restart mdns-repeater.service')
+ call('systemctl restart avahi-daemon.service')
return None