Skip to content

Commit

Permalink
fix(mdns): add specific network interface for the pytest script
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 committed Jan 8, 2024
1 parent b17c45b commit cb5c662
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/mdns/examples/query_advertise/pytest_mdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def mdns_server(esp_host, events):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, 'eth0\0'.encode('utf-8'))
sock.setblocking(False)
sock.bind((UDP_IP, UDP_PORT))
mreq = struct.pack('4sl', socket.inet_aton(MCAST_GRP), socket.INADDR_ANY)
Expand Down

0 comments on commit cb5c662

Please sign in to comment.