Commit 2805de89 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

client6: Listen on all interfaces

parent 72d3499e
......@@ -16,7 +16,12 @@ sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
sock.bind(server_address)
# on all interfaces.
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, socket.inet_pton(socket.AF_INET6, args.multicast_group) + struct.pack('@I', 0))
for ifidx, ifname in socket.socket.if_nameindex():
print("joining %s @ [%d]%s" % (args.multicast_group, ifidx, ifname))
bifidx = struct.pack("@i", ifidx)
mreq = socket.inet_pton(socket.AF_INET6, args.multicast_group) + \
bifidx
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, mreq) # = IPV6_ADD_MEMBERSHIP
try:
while True:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment