I wasn't able to find any change you may have made earlier related to this issue. I was surprised, however, to learn that discovery & login apparently use the same codepath (albeit in two different processes, iscsiadm & iscsid) for creating sockets. The call to setsockopt(SO_BINDTODEVICE) applies in both cases, contrary to the portion of the README (section 5.1.3) that says:
"Be aware that iscsiadm will use the default route to do discovery. It will not use the iface specified." In any case, the patch works for me and does what I want. I confirmed this on my end with strace & lsof, showing that bind() and/or setsockopt() was getting called appropriately. Note that bad things will happen (hangs/timeouts) if the administrator configures both iface.ipaddress and iface.net_ifacename where the specified IP address belongs to some other interface. Tom.III On Tuesday, March 31, 2015 at 10:44:46 AM UTC-7, Thomas Dwyer III wrote: > > Currently, open-iscsi ignores iface.ipaddress whether or not > iface.net_ifacename is configured. This can be problematic if/when a > network interface is configured with multiple IP addresses and a target > only allows connections from one of them. This patch adds support for > iface.ipaddress, calling bind() and/or setsockopt(SO_BINDTODEVICE) > depending on which iface parameters are changed from their default values. > In other words, the following combinations are now permitted (1 & 2 are > current behavior, 3 & 4 are new behavior): > > > 1. Neither of iface.net_ifacename and iface.ipaddress are configured. > The code lets the operating system choose an appropriate local IP address > and interface based on the portal address. > 2. Only iface.net_ifacename is configured. The code calls > setsockopt(SO_BINDTODEVICE) and then lets the operating system choose > an appropriate local IP address. > 3. Only iface.ipaddress is configured. The code calls bind() and lets > the operating system choose an appropriate interface. > 4. Both of iface.net_ifacename and iface.ipaddress are configured. The > code calls both bind() and setsockopt(SO_BINDTODEVICE). The > administrator must ensure that the combination of iface.net_ifacename > and iface.ipaddress is an appropriate configuration. > > > Thanks for your consideration. > > > Regards, > Tom.III > > -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/d/optout.
