From 1ec5231ebe4e7422958afb25f1c2dc41aefe3bb1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 5 Jan 2021 15:17:23 -0500 Subject: [PATCH] Do not reply to mismatched IP in confluent search If an OS queries for confluent, but will not have a viable address, avoid replying to let more usable network paths prevail. For example, one OS was coming up with 169.254 with no dhcp server, and being told it could do well to talk to 172.29, which obviously would not work. --- confluent_server/confluent/discovery/protocols/ssdp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_server/confluent/discovery/protocols/ssdp.py b/confluent_server/confluent/discovery/protocols/ssdp.py index 6dbdab4e..86977674 100644 --- a/confluent_server/confluent/discovery/protocols/ssdp.py +++ b/confluent_server/confluent/discovery/protocols/ssdp.py @@ -202,6 +202,8 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None): cfg, node, ifidx=iface) if ncfg.get('matchesnodename', None): reply += 'DEFAULTNET: 1\r\n' + elif not netutil.address_is_local(peer[0]): + continue if not isinstance(reply, bytes): reply = reply.encode('utf8') s.sendto(reply, peer)