arriven/db1000n

Implement --interface option for non-linux systems

arriven opened this issue · 3 comments

--interface option uses syscall.BindToDevice which is only available for linux. It should be possible to use net.InterfaceByName inside conn.Control to get an addr that could then be transformed into sockaddr for regular syscall.Bind which is available for all unix systems. Doing it in the control function should be enough to not have troubles when network changes at runtime

I think I've implemented it in 9fbca3f but it needs some additional testing

@deputinizer you were the one who initially requested the feature, can you check if this implementation has any issues compared to BindToDevice?

Yeah, I'm not looking to implementing that on windows, just wanted to ensure that it works properly on unix without BindToDevice