[stgt] [PATCH] Fix IPv6 discovery by stripping Zone ID

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Tue Mar 5 03:04:46 CET 2013


On Mon,  4 Mar 2013 15:15:57 -0800
Lee Duncan <lduncan at suse.com> wrote:

> This strips off the "%ZONEID" that can be at the end of IPv6

'Can' means that possibly the string doesn't exist, right? The
following code works in such case?

> addresses returned by getnameinfo(). Without this, IPv6 discovery
> fails because the address has something like "%eth0" appended to it.
> 
> Signed of by: Lee Duncan <lduncan at suse.com>
> ---
>  usr/iscsi/iscsid.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
> index 9614001..b10be1d 100644
> --- a/usr/iscsi/iscsid.c
> +++ b/usr/iscsi/iscsid.c
> @@ -871,6 +871,10 @@ static void text_scan_text(struct iscsi_connection *conn)
>  				continue;
>  			}
>  
> +			/* strip zone id */
> +			if (ss.ss_family == AF_INET6)
> +				(void) strsep(&p, "%");
> +
>  			p = buf + strlen(buf);
>  
>  			if (ss.ss_family == AF_INET6)
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stgt" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list