Open tahajahangir opened 4 years ago
The existing -b
option only works when the specified IP is on the same interface as the default route interface. When machine have multiple interfaces and the bind-ip is not on the default interface, this options solves the problem.
Nice feature, but works only under linux.
what prevents you from using the ip address of the specified interface with the existing -b option?
It would be nice to listen on a different interface that the outgoing connections.
The problem is that if the IP address set by the -b
option is on the default route, the default route will be used and not the specified interface.
I've patched this PR against master and it works and does exactly what I needed. Would you consider accepting it, please?
i can't merge this PR as-is, because it would break build on solaris, *BSD, and OSX
It is a matter of surrounding the Linux-specific code with #if[def]
fences?
i dont want to litter the code with ugly ifdefs, they need to be in a single spot, if at all
For anyone else looking for this functionality. Dante doesn't have it either, their external
option lets you "bind" to an interface by name but in practice works the same way using the default route. :cry: But this PR works perfectly, thanks @tahajahangir !
I do appreciate that @rofl0r doesn't want to clutter such a clean minimalist project.
SO_BINDTODEVICE seems to be a linux-specific API. what prevents you from using the ip address of the specified interface with the existing -b option?