> The returned struct sockaddr from getsockname() will contain the > IP address of the interface that the supplied IP address will be > using. From there, you should be able to figure out the interface name > by walking the interface list. Fails if you have the same local address on more than one interface. --