diff --git a/confluent_server/confluent/discovery/protocols/ssdp.py b/confluent_server/confluent/discovery/protocols/ssdp.py index 47991ba8..3b225759 100644 --- a/confluent_server/confluent/discovery/protocols/ssdp.py +++ b/confluent_server/confluent/discovery/protocols/ssdp.py @@ -258,10 +258,14 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None): seconds = int(currtime) msecs = int(currtime * 1000 % 1000) reply = 'HTTP/1.1 200 OK\r\nNODENAME: {0}\r\nCURRTIME: {1}\r\nCURRMSECS: {2}\r\n'.format(node, seconds, msecs) - if '%' in peer[0]: - iface = socket.getaddrinfo(peer[0], 0, socket.AF_INET6, socket.SOCK_DGRAM)[0][-1][-1] - reply += 'MGTIFACE: {0}\r\n'.format( - peer[0].split('%', 1)[1]) + if netutil.ip_on_same_subnet(peer[0], 'fe80::', 64): + if '%' in peer[0]: + ifidx = peer[0].split('%', 1)[1] + iface = socket.getaddrinfo(peer[0], 0, socket.AF_INET6, socket.SOCK_DGRAM)[0][-1][-1] + else: + ifidx = '{}'.format(peer[-1]) + iface = peer[-1] + reply += 'MGTIFACE: {0}\r\n'.format(ifidx) ncfg = netutil.get_nic_config( cfg, node, ifidx=iface) if ncfg.get('matchesnodename', None):