The is_ipv6 flag (runtime iface rec representation only, not on disk)
was being set when creating ifaces from sysfs, but not when reading them
in from an iface record file. This caused ipv6 iface records to be
reported as malformed and ignored.

Fix that with a name check for an "ipv6" substring. Old code also looked
at other fields, this is enough to fix iface records created from sysfs
for be2iscsi and qla4xxx. Further fixes might be required for other IPv6
configurations.
---
 libopeniscsiusr/idbm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libopeniscsiusr/idbm.c b/libopeniscsiusr/idbm.c
index f7dc5923bb74..44f8a54caee2 100644
--- a/libopeniscsiusr/idbm.c
+++ b/libopeniscsiusr/idbm.c
@@ -841,6 +841,9 @@ int _idbm_iface_get(struct iscsi_context *ctx, const char 
*iface_name, struct
        snprintf((*iface)->name, sizeof((*iface)->name)/sizeof(char),
                 "%s", iface_name);
 
+       if (strstr(iface_name, "ipv6"))
+               (*iface)->is_ipv6 = true;
+
        recs = _idbm_recs_alloc();
        _alloc_null_check(ctx, recs, rc, out);
 
-- 
2.14.4

-- 
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 https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to