summaryrefslogtreecommitdiff
path: root/usr/idbm.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-06-11 17:08:25 -0500
committerMike Christie <michaelc@cs.wisc.edu>2008-06-13 16:42:11 -0500
commit055f36ffc2b92bd29fef63bc324820780c9d7dfe (patch)
tree9de299fce06ce3b496864db65cf6e0bef43d0ac4 /usr/idbm.c
parent0b6788b07d7e479a344d05754ed087eb2f9c6c33 (diff)
downloadopen-iscsi-055f36ffc2b92bd29fef63bc324820780c9d7dfe.tar.gz
Fix discovery and autobinding
Only autobind to the default iface if no ifaces are passed in. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Diffstat (limited to 'usr/idbm.c')
-rw-r--r--usr/idbm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr/idbm.c b/usr/idbm.c
index a01fcba..f915e8f 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -1749,8 +1749,12 @@ int idbm_bind_ifaces_to_node(struct node_rec *new_rec, struct list_head *ifaces,
list_for_each_entry_safe(iface, tmp, &def_ifaces, list) {
list_del(&iface->list);
t = iscsi_sysfs_get_transport_by_name(iface->transport_name);
- /* only auto bind to software iscsi */
- if (!t || strcmp(t->name, DEFAULT_TRANSPORT)) {
+ /*
+ * only auto bind to software iscsi if it is
+ * not the default iface (that is handled below)
+ */
+ if (!t || strcmp(t->name, DEFAULT_TRANSPORT) ||
+ !strcmp(iface->name, DEFAULT_IFACENAME)) {
free(iface);
continue;
}
@@ -1811,7 +1815,8 @@ int idbm_add_nodes(node_rec_t *newrec, discovery_rec_t *drec,
list_del(&iface->list);
t = iscsi_sysfs_get_transport_by_name(iface->transport_name);
/* only auto bind to software iscsi */
- if (!t || strcmp(t->name, DEFAULT_TRANSPORT)) {
+ if (!t || strcmp(t->name, DEFAULT_TRANSPORT) ||
+ !strcmp(iface->name, DEFAULT_IFACENAME)) {
free(iface);
continue;
}