>>> Chris Leech <cle...@redhat.com> schrieb am 13.06.2018 um 17:25 in Nachricht <20180613152545.1049967-5-cle...@redhat.com>: > 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; > +
Hi! As a matter of style, I would use some symbolic constant instead of "ipv6" when that string is some "magic constant" (Of course, not just here, but everywhere). Regards, Ulrich > 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 open-iscsi+unsubscr...@googlegroups.com. > To post to this group, send email to open-iscsi@googlegroups.com. > Visit this group at https://groups.google.com/group/open-iscsi. > For more options, visit https://groups.google.com/d/optout. -- 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 open-iscsi+unsubscr...@googlegroups.com. To post to this group, send email to open-iscsi@googlegroups.com. Visit this group at https://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/d/optout.