summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorJim Ramsay <jim_ramsay@dell.com>2011-07-20 09:06:45 -0400
committerMike Christie <michaelc@cs.wisc.edu>2011-08-02 00:04:17 -0500
commit4c93bba5ea9610fce9999ff7dc21f28b90e947d8 (patch)
treefe71b60b7f3bf9c373a2c0fd6f5c24e5efcf95e4 /usr
parentf69f9d781a537d4cce1e7c90779feabb052f87e5 (diff)
downloadopen-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.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr/io.c b/usr/io.c
index fef6785..8d37d43 100644
--- a/usr/io.c
+++ b/usr/io.c
@@ -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