[stgt] [PATCH 1/1] iscsi: add support to use multiple portals for iscsi

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Thu Apr 14 12:23:45 CEST 2011


On Sat, 9 Apr 2011 12:49:48 +1000
ronnie sahlberg <ronniesahlberg at gmail.com> wrote:

> From a0da7338636798417a232b8482244c84728d6596 Mon Sep 17 00:00:00 2001
> From: Ronnie Sahlberg <ronniesahlberg at gmail.com>
> Date: Sat, 9 Apr 2011 12:41:05 +1000
> Subject: [PATCH] Add support for multiple portals,
>  keep a list of the portals that are in use, and have this list
>  default to [0::0] and 0.0.0.0 wilcards for ipv6/ipv4 in case the user
>  does not specify a portal.
> 
> This allows
> tgtd --iscsi portal=10.1.1.1:3260,portal=10.1.1.2:3261,portal=10.1.1.2:3262
> 
> Signed-off-by: Ronnie Sahlberg <ronniesahlberg at gmail.com>
> ---
>  usr/iscsi/iscsi_tcp.c |   30 +++++++++++++++++++++++++++---
>  usr/iscsi/iscsid.c    |   43 +++++++++++++++++++++++++++++++------------
>  usr/iscsi/iscsid.h    |   11 +++++++++--
>  usr/iscsi/isns.c      |   15 ++++++++++-----
>  4 files changed, 77 insertions(+), 22 deletions(-)

one more minor comment,

>  				continue;
> @@ -861,7 +873,15 @@ static void text_scan_text(struct iscsi_connection *conn)
>  			if (ss.ss_family == AF_INET6)
>  				 *p++ = ']';
>  
> -			sprintf(p, ":%d,1", iscsi_listen_port);
> +			if (ss.ss_family == AF_INET6) {
> +				port = ntohs(((struct sockaddr_in6 *)
> +						&ss)->sin6_port);

You don't need {} for a single line.

> +			} else {
> +				port = ntohs(((struct sockaddr_in *)
> +						&ss)->sin_port);
> +			}

Ditto.
--
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