]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: ignore mDNS multicast packets originated from our host
authorDmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Fri, 2 Dec 2016 09:30:00 +0000 (11:30 +0200)
committerDmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Thu, 19 Jan 2017 09:51:21 +0000 (11:51 +0200)
By default all sent multicast packets are looped back to the
sending host. And since the code that adds the mDNS socket to
the mDNS multicast group is the same as for LLMNR I decided
that for now it'd be safer to filter looped back packets in the
application than to switch loopback off. Because I don't know
what would be the implications for LLMNR with loopback switched off.

I suspect that loopback can be disabled for LLMNR safely too and the
function manager_our_packet() is not really needed. But I'd
prefer to do it in another patchset.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
src/resolve/resolved-mdns.c

index b13b1d0144d6279d5423da2e84fbaf19bf59dbc6..2efaa55d8d77c7eaf1606eda5453e64a504a9a28 100644 (file)
@@ -77,6 +77,9 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us
         if (r <= 0)
                 return r;
 
+        if (manager_our_packet(m, p))
+                return 0;
+
         scope = manager_find_scope(m, p);
         if (!scope) {
                 log_warning("Got mDNS UDP packet on unknown scope. Ignoring.");