lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111208204749.GC32505@fieldses.org>
Date:	Thu, 8 Dec 2011 15:47:49 -0500
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	Stanislav Kinsbursky <skinsbursky@...allels.com>
Cc:	Trond.Myklebust@...app.com, linux-nfs@...r.kernel.org,
	xemul@...allels.com, neilb@...e.de, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, jbottomley@...allels.com,
	davem@...emloft.net, devel@...nvz.org
Subject: Re: [PATCH 1/4] SUNRPC: use passed network namespace context in
 rpc_parse_scope_id()

On Wed, Dec 07, 2011 at 03:20:16PM +0300, Stanislav Kinsbursky wrote:
> Use incomming network context in rpc_parse_scope_id() instead of hard-coded

Changelogs are a little confusing; I might have said "allow
rpc_parse_cope_id() caller to pass in network context instead of using
hard-code "init_net"."

--b.

> "init_net".
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@...allels.com>
> 
> ---
>  net/sunrpc/addr.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c
> index 67a655e..35eb188 100644
> --- a/net/sunrpc/addr.c
> +++ b/net/sunrpc/addr.c
> @@ -156,8 +156,9 @@ static size_t rpc_pton4(const char *buf, const size_t buflen,
>  }
>  
>  #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> -static int rpc_parse_scope_id(const char *buf, const size_t buflen,
> -			      const char *delim, struct sockaddr_in6 *sin6)
> +static int rpc_parse_scope_id(struct net *net, const char *buf,
> +			      const size_t buflen, const char *delim,
> +			      struct sockaddr_in6 *sin6)
>  {
>  	char *p;
>  	size_t len;
> @@ -177,7 +178,7 @@ static int rpc_parse_scope_id(const char *buf, const size_t buflen,
>  		unsigned long scope_id = 0;
>  		struct net_device *dev;
>  
> -		dev = dev_get_by_name(&init_net, p);
> +		dev = dev_get_by_name(net, p);
>  		if (dev != NULL) {
>  			scope_id = dev->ifindex;
>  			dev_put(dev);
> @@ -213,7 +214,7 @@ static size_t rpc_pton6(const char *buf, const size_t buflen,
>  	if (in6_pton(buf, buflen, addr, IPV6_SCOPE_DELIMITER, &delim) == 0)
>  		return 0;
>  
> -	if (!rpc_parse_scope_id(buf, buflen, delim, sin6))
> +	if (!rpc_parse_scope_id(&init_net, buf, buflen, delim, sin6))
>  		return 0;
>  
>  	sin6->sin6_family = AF_INET6;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ