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

linux: allow listening on all interfaces #18

Closed jsimonetti closed 6 years ago

jsimonetti commented 6 years ago

This commit will allow listening on all interfaces by specifying nil for the interface.

I have not looked at BSD properly, but it appears, that on BSD the BPF filter is used to filter on interfaces and not setting the interface part of the BPF filter should equal the result. However, I lack the knowledge to prperly judge the effects of such a change.

mdlayher commented 6 years ago

As mentioned on Slack:

I get the feeling we shouldn't pursue this route. It'd complicate the BSD code in particular since you'd probably have to do net.Interfaces() and set them all up. I think having the caller do it is probably best.

Is that an acceptable solution?

jsimonetti commented 6 years ago

I agree. In hindsight this is probably not the best solution. Thanks.