alsmith / multicast-relay

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

modify udp packet is wrong and generates invalid udp #37

Closed TinoLange closed 4 years ago

TinoLange commented 4 years ago

https://github.com/alsmith/multicast-relay/blob/503fc498894ede308ef98987f16fbcc68c87dc64/multicast-relay.py#L332

Hi!

The code above generates invalid, huge UDP packages. The + data[ipHeaderLength:] adds the whole packet (all after the header). That summand needs to be removed.

So correct line should just look like: ipHeader = data[:ipHeaderLength-8] + socket.inet_aton(srcAddr) + socket.inet_aton(dstAddr)

Best regards

Tino

alsmith commented 4 years ago

Thanks for the report - fixed in 503fc49.