alsmith / multicast-relay

Relay multicast and broadcast packets between interfaces.
GNU General Public License v3.0
304 stars 47 forks source link

'relay' option doesn't capture UPD packets #60

Open yvernhurenat opened 2 years ago

yvernhurenat commented 2 years ago

I have an app sending multicast packets on 239.255.90.90. I can see the packets with tcpdump, but multicast-relay does not capture any packets...

python3 multicast-relay.py --interfaces eth0 --remote REMOTE_IP --foreground --verbose --remotePort 1990 --noSonosDiscovery --noSSDP --noMDNS --relay 239.255.90.90:APP_PORT

if I try the homebrewNetifaces instead, I get the following error:

Nov-25 22:30:52 multicast-relay.py INFO: Adding multicast relay for 239.255.90.90:APP_PORT
Traceback (most recent call last):
  File "multicast-relay.py", line 1014, in <module>
    sys.exit(main())
  File "multicast-relay.py", line 1009, in main
    packetRelay.addListener(addr, port, relay[1])
  File "multicast-relay.py", line 287, in addListener
    (ifname, mac, ip, netmask, broadcast) = self.getInterface(interface)
  File "multicast-relay.py", line 723, in getInterface
    if interface in self.nif.interfaces():
  File "multicast-relay.py", line 104, in interfaces
    ip        = socket.inet_ntoa(fcntl.ioctl(socket.socket(socket.AF_INET, socket.SOCK_DGRAM), 0x8915, struct.pack('256s', str(name)))[20:24]) # SIOCGIFADDR
struct.error: argument for 's' must be a bytes object
yvernhurenat commented 2 years ago

Would also be great, if we could capture broadcast traffic on IPs like 192.168.1.255, or is there any reason against?