1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-31 05:47:30 +03:00

resolved: stop mdns/lnrr when config changes to disabled on reload

Currently on reload mdns/lnrr are enabled if they were disabled,
but not viceversa. Fix it.

Follow-up for 14a52176798bc2d013297b503ac6fa49a64e2725

(cherry picked from commit 2976730a4d34749bfb7a88da341464f1834ab1c6)
This commit is contained in:
Luca Boccassi 2025-01-02 17:30:21 +00:00
parent 47f9a9879a
commit 331888d165
3 changed files with 8 additions and 2 deletions

View File

@ -103,6 +103,7 @@ Packages=
kmod
less
llvm
lsof
lvm2
man
mdadm

View File

@ -651,13 +651,16 @@ int link_update(Link *l) {
r = manager_llmnr_start(l->manager);
if (r < 0)
return r;
}
} else
manager_llmnr_stop(l->manager);
if (link_get_mdns_support(l) != RESOLVE_SUPPORT_NO) {
r = manager_mdns_start(l->manager);
if (r < 0)
return r;
}
} else
manager_mdns_stop(l->manager);
link_allocate_scopes(l);
link_add_rrs(l, false);

View File

@ -339,6 +339,7 @@ manual_testcase_02_mdns_llmnr() {
# defaults to yes (both the global and per-link settings are yes)
assert_in 'yes' "$(resolvectl mdns hoge)"
assert_in 'yes' "$(resolvectl llmnr hoge)"
lsof -p "$(systemctl show --property MainPID --value systemd-resolved.service)" | grep -q ":mdns\|:5353"
# set per-link setting
resolvectl mdns hoge yes
resolvectl llmnr hoge yes
@ -379,6 +380,7 @@ manual_testcase_02_mdns_llmnr() {
echo "LLMNR=no"
} >/run/systemd/resolved.conf.d/mdns-llmnr.conf
systemctl reload systemd-resolved.service
(! lsof -p "$(systemctl show --property MainPID --value systemd-resolved.service)" | grep -q ":mdns\|:5353")
# set per-link setting
resolvectl mdns hoge yes
resolvectl llmnr hoge yes