]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemd.dnssd does not handle local requests (#32991)
authorAlain Greppin <agreppin@chilibi.ch>
Sun, 21 Jul 2024 11:48:56 +0000 (13:48 +0200)
committerGitHub <noreply@github.com>
Sun, 21 Jul 2024 11:48:56 +0000 (12:48 +0100)
systemd.dnssd does not handle local requests

Fixes https://github.com/systemd/systemd/issues/32990

src/resolve/resolved-mdns.c

index 8f93af38cffb69001265e862f7ae83ac54f79c78..0fb83a3c229492b3aa0df315b6fadd5778adbd30 100644 (file)
@@ -386,7 +386,10 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us
         if (r <= 0)
                 return r;
 
-        if (manager_packet_from_local_address(m, p))
+        /* Refuse traffic from the local host, to avoid query loops. However, allow legacy mDNS
+         * unicast queries through anyway (we never send those ourselves, hence no risk).
+         * i.e. check for the source port nr. */
+        if (p->sender_port == MDNS_PORT && manager_packet_from_local_address(m, p))
                 return 0;
 
         scope = manager_find_scope(m, p);