On 09/03/2011, Markus Kötter wrote: > David Sommerseth wrote: > > One is that you do resolve the IP address based on the device > > name. What if the IP address changes on that device? It would > > be anticipated by most users that it would then listen to the new > > IP address. When being done via the command line, it is much > > more obvious OpenVPN needs to be restarted on an IP address > > change. > You do not want to get into supporting changing addresses, really. > While libnl would work for linux, but that does not cover bsds or > anything else.
Agreed! > To do this properly ... > Either use SO_BINDTODEVICE, which is not portable again, or > getifaddrs() to gather the addresses for the interface and > multi-listen the daemon - which is not implemented. > Neither getifaddrs nor SO_BINDTODEVICE are 100% portable, so there > is no real proper way, nevertheless getifaddrs would be my choice. I agree that getifaddrs() would be a better way of doing this *if* the deamon knew how to multi-listen (or, to put it in another way, *when* the daemon lerns to). While I am willing to revise the code to use getifaddr() if that will make it more palatable to the project, the current approach does work and seems to me to be more portable. Fede