mdlayher / raw

Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed.
MIT License
425 stars 71 forks source link

add setMulticast function #64

Open pyther opened 4 years ago

pyther commented 4 years ago

This allows the interface to subscribe to a link-layer multicast address.

I've written a small program to proxy eap packets from one interface to another. EAP (802.1x Auth) packets are sent to a link-layer multicast address. The Interface must either subscribe to the Multicast Address or be put in promisc mode. https://github.com/pyther/goeap_proxy/

I wanted to put this out there as a starting point for discussion. Let me know what you think. Not sure if this is the best way to accomplish this? Maybe exposing SetSockoptPacketMreq to raw.conn is some capacity would allow for more flexibility?

ctrochalakis commented 4 years ago

Hello, I am also interested in linux multicast support. There is another older open PR about this (https://github.com/mdlayher/raw/pull/11), with a slightly different API allowing to leave a multicast group (func (p *packetConn) SetMulticast(b bool, addr net.HardwareAddr) error).

Perhaps we could merge linux support as a first step?