diff options
author | Jim Ramsay <jim_ramsay@dell.com> | 2011-07-20 09:06:45 -0400 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2011-08-02 00:04:17 -0500 |
commit | 4c93bba5ea9610fce9999ff7dc21f28b90e947d8 (patch) | |
tree | fe71b60b7f3bf9c373a2c0fd6f5c24e5efcf95e4 /usr | |
parent | f69f9d781a537d4cce1e7c90779feabb052f87e5 (diff) | |
download | open-iscsi-4c93bba5ea9610fce9999ff7dc21f28b90e947d8.tar.gz |
Revise bind_conn_to_iface logic
This now explicitly enforces the logic already hinted at, which should prefer
hardware address over net_ifacename in all circumstances. Previously the 'else
if' was always being executed.
Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
Diffstat (limited to 'usr')
-rw-r--r-- | usr/io.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -303,14 +303,16 @@ static int bind_conn_to_iface(iscsi_conn_t *conn, struct iface_rec *iface) return 0; memset(session->netdev, 0, IFNAMSIZ); - if (iface_is_bound_by_hwaddr(iface) && - net_get_netdev_from_hwaddress(iface->hwaddress, session->netdev)) { - log_error("Cannot match %s to net/scsi interface.", - iface->hwaddress); - return -1; - } else if (iface_is_bound_by_netdev(iface)) + if (iface_is_bound_by_hwaddr(iface)) { + if (net_get_netdev_from_hwaddress(iface->hwaddress, + session->netdev)) { + log_error("Cannot match %s to net/scsi interface.", + iface->hwaddress); + return -1; + } + } else if (iface_is_bound_by_netdev(iface)) { strcpy(session->netdev, iface->netdev); - else if (iface_is_bound_by_ipaddr(iface)) { + } else if (iface_is_bound_by_ipaddr(iface)) { /* * we never supported this but now with offload having to * set the ip address in the iface, useris may forget to |