From d84ee65eaad902bb41fa6bae1f8127e03cb63506 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 30 Mar 2016 17:55:03 +0200 Subject: [PATCH] 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 --- utils/iscsi-ls.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/iscsi-ls.c b/utils/iscsi-ls.c index bce6fc9..0a06224 100644 --- a/utils/iscsi-ls.c +++ b/utils/iscsi-ls.c @@ -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");