/* This is one of those areas where the initial VMS concepts don't really map onto the Linux concepts, and since we introduced multiple addresses per interface we have to cope with slightly odd ways of finding out what "our address" really is. Mostly it's not a problem; for this we just guess a sensible default. Eventually the routing code will take care of all the nasties for us I hope.  */
int dn_dev_bind_default(__le16 *addr)
/* This is one of those areas where the initial VMS concepts don't really map onto the Linux concepts, and since we introduced multiple addresses per interface we have to cope with slightly odd ways of finding out what "our address" really is. Mostly it's not a problem; for this we just guess a sensible default. Eventually the routing code will take care of all the nasties for us I hope.  */
int dn_dev_bind_default(__le16 *addr)
{
	struct net_device *dev;
	int rv;
	dev = dn_dev_get_default();
last_chance:
	if (dev) {
		rv = dn_dev_get_first(dev, addr);
		dev_put(dev);
		if (rv == 0 || dev == init_net.loopback_dev)
			return rv;
	}
	dev = init_net.loopback_dev;
	dev_hold(dev);
	goto last_chance;
}