[stgt] [PATCH] print source ip to log when tcp connection is accepted

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed Feb 2 01:11:05 CET 2011


On Tue, 1 Feb 2011 19:19:03 +0200
Alexander Nezhinsky <alexandern at Voltaire.COM> wrote:

> iscsi: print source ip to log when tcp connection is accepted
> 
> Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
> ---
>  usr/iscsi/iscsi_tcp.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/usr/iscsi/iscsi_tcp.c b/usr/iscsi/iscsi_tcp.c
> index 0fbb671..338b5c9 100644
> --- a/usr/iscsi/iscsi_tcp.c
> +++ b/usr/iscsi/iscsi_tcp.c
> @@ -95,6 +95,7 @@ static void accept_connection(int afd, int events, void *data)
>  	struct iscsi_connection *conn;
>  	struct iscsi_tcp_connection *tcp_conn;
>  	int fd, ret;
> +	char host[NI_MAXHOST];
>  
>  	dprintf("%d\n", afd);
>  
> @@ -105,6 +106,12 @@ static void accept_connection(int afd, int events, void *data)
>  		return;
>  	}
>  
> +	ret = getnameinfo((struct sockaddr *) &from, sizeof(from),
> +			  host, sizeof(host), NULL, 0, NI_NUMERICHOST);
> +	if (ret)
> +		strcpy(host, "Unresolved");
> +	eprintf("from %s\n", host);

Why do we need this?

It's not failure, critical issues, or warnings. I don't see why we
need to print such info.
--
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