iscsi-ls: skip link-local IPv6 addresses

Some iSCSI targets provide a link-local IPv6 address as a portal, but that
is unusable without knowing the interface (aka scope-id) to use for the
connection.  This causes iscsi-ls to report an EINVAL and exit.  Just
skip the error.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini
2016-03-30 17:55:03 +02:00
parent 8afffbd506
commit d84ee65eaa

View File

@@ -174,6 +174,11 @@ void list_luns(struct client_state *clnt, const char *target, const char *portal
int full_report_size;
int i;
if (strncasecmp(portal, "[fe80:", 6) == 0) {
fprintf(stderr, "skipping link-local address\n");
return;
}
iscsi = iscsi_create_context(initiator);
if (iscsi == NULL) {
printf("Failed to create context\n");