All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: Trond.Myklebust@netapp.com, linux-nfs@vger.kernel.org,
	xemul@parallels.com, neilb@suse.de, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, jbottomley@parallels.com,
	davem@davemloft.net, devel@openvz.org
Subject: Re: [PATCH 1/4] SUNRPC: use passed network namespace context in rpc_parse_scope_id()
Date: Thu, 8 Dec 2011 15:47:49 -0500	[thread overview]
Message-ID: <20111208204749.GC32505@fieldses.org> (raw)
In-Reply-To: <20111207112016.17273.44510.stgit@localhost6.localdomain6>

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@parallels.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;
> 

  reply	other threads:[~2011-12-08 20:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07 12:20 [PATCH 0/4] SUNRPC: pass network namespace context to sockaddr construction routines Stanislav Kinsbursky
2011-12-07 12:20 ` [PATCH 1/4] SUNRPC: use passed network namespace context in rpc_parse_scope_id() Stanislav Kinsbursky
2011-12-08 20:47   ` J. Bruce Fields [this message]
2011-12-12 16:03     ` Stanislav Kinsbursky
2011-12-12 16:07       ` J. Bruce Fields
2011-12-12 16:07         ` J. Bruce Fields
2011-12-12 16:18         ` Stanislav Kinsbursky
2011-12-07 12:20 ` [PATCH 2/4] SUNRPC: use passed network namespace context in rpc_pton6() Stanislav Kinsbursky
2011-12-07 12:20 ` [PATCH 3/4] SUNRPC: use passed network namespace context in rpc_pton() Stanislav Kinsbursky
2011-12-07 12:20 ` [PATCH 4/4] SUNRPC: use passed network namespace context in rpc_uaddr2sockaddr() Stanislav Kinsbursky
2011-12-08 20:46 ` [PATCH 0/4] SUNRPC: pass network namespace context to sockaddr construction routines J. Bruce Fields
2011-12-08 20:46   ` J. Bruce Fields
2011-12-12 16:13   ` Stanislav Kinsbursky
2011-12-12 16:15     ` J. Bruce Fields
2011-12-12 16:15       ` J. Bruce Fields
2011-12-12 16:27       ` Stanislav Kinsbursky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111208204749.GC32505@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=davem@davemloft.net \
    --cc=devel@openvz.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    --cc=skinsbursky@parallels.com \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.