Re: Skipping iscsi_ntop6()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2011-08-13 at 23:47 +0100, Chris Boot wrote:
> On 13/08/2011 15:23, Chris Boot wrote:
> > Hi folks,
> >
> > I was having a look through the configfs properties on my iSCSI server and noticed that initiators that connect over IPv6 don't seem to have their IP address show up /sys/kernel/config/target/iscsi/$IQN_TGT/$TPGT/acls/$IQN_INIT/info. I had a quick look through the code and it seems the following block of code is to blame. Without playing with this at all, is there a reason this is commented out?
> >
> > Both Windows and Linux seem to work perfectly fine with iSCSI over IPv6, and it would be nice to see the initiator IP address in the stats.
> >
> > #if 0
> >          if (!iscsi_ntop6((const unsigned char *)
> >                  &sock_in6.sin6_addr.in6_u,
> >                  (char *)&conn->ipv6_login_ip[0],
> >                  IPV6_ADDRESS_SPACE)) {
> >              pr_err("iscsi_ntop6() failed\n");
> >              iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
> >                      ISCSI_LOGIN_STATUS_TARGET_ERROR);
> >              goto new_sess_out;
> >          }
> > #else
> >          pr_debug("Skipping iscsi_ntop6()\n");
> > #endif
> 
> Well I took some initiative and wrote up the attached patch. I've copied 
> it below but I know Thunderbird mangles tabs and I can't work out how to 
> stop it doing so.
> 
>      Implement iSCSI target IPv6 address printing.
> 
>      The iSCSI target configfs code to print out an initiator's IPv6 address
>      is not fully implemented. This patch uses snprintf() with the "%pI6c"
>      format string to format the IPv6 address for display purposes.
> 
>      Signed-off-by: Chris Boot <bootc@xxxxxxxxx>
> 

Thanks for fixing up this long time informational breakage, and for
testing the bleeding edge v3.1 code with IPv6 LIO target endpoints!

Added into lio-core-2.6.git/master with the following:

commit 47993caf9ef698a252d73caebf1703db150b4a04
Author: Chris Boot <bootc@xxxxxxxxx>
Date:   Sat Aug 13 22:10:46 2011 -0700

    iscsi-target: Implement iSCSI target IPv6 address printing.

Also just a FYI for submitting future patches, git-format-patch and
git-send-email are your best friends here.  8-)

--nab

> diff --git a/drivers/target/iscsi/iscsi_target_login.c 
> b/drivers/target/iscsi/iscsi_target_login.c
> index bcaf82f..e0e931b 100644
> --- a/drivers/target/iscsi/iscsi_target_login.c
> +++ b/drivers/target/iscsi/iscsi_target_login.c
> @@ -1013,19 +1013,9 @@ static int __iscsi_target_login_thread(struct 
> iscsi_np *np)
>                       ISCSI_LOGIN_STATUS_TARGET_ERROR);
>               goto new_sess_out;
>           }
> -#if 0
> -        if (!iscsi_ntop6((const unsigned char *)
> - &sock_in6.sin6_addr.in6_u,
> -                (char *)&conn->ipv6_login_ip[0],
> -                IPV6_ADDRESS_SPACE)) {
> -            pr_err("iscsi_ntop6() failed\n");
> -            iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
> -                    ISCSI_LOGIN_STATUS_TARGET_ERROR);
> -            goto new_sess_out;
> -        }
> -#else
> -        pr_debug("Skipping iscsi_ntop6()\n");
> -#endif
> +        snprintf(conn->login_ip, sizeof(conn->login_ip), "%pI6c",
> + &sock_in6.sin6_addr.in6_u);
> +        conn->login_port = ntohs(sock_in6.sin6_port);
>       } else {
>           memset(&sock_in, 0, sizeof(struct sockaddr_in));
> 

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux