netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: davem@davemloft.net, kaber@trash.net
Cc: netdev@vger.kernel.org, linux-next@vger.kernel.org,
	xemul@openvz.org, adobriyan@gmail.com,
	Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [RFC 1/4] net: sysctl_net - use net_eq to compare nets
Date: Mon, 09 Mar 2009 21:16:29 +0300	[thread overview]
Message-ID: <20090309182731.621869188@gmail.com> (raw)
In-Reply-To: 20090309181628.109019157@gmail.com

[-- Attachment #1: net-sysctl-net-use-net_eq --]
[-- Type: text/plain, Size: 757 bytes --]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---

Btw, wouldn't be better to have a special macro/inline
to check if net is init_net? Something like is_init_net()

 net/sysctl_net.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.git/net/sysctl_net.c
===================================================================
--- linux-2.6.git.orig/net/sysctl_net.c
+++ linux-2.6.git/net/sysctl_net.c
@@ -61,7 +61,7 @@ static struct ctl_table_root net_sysctl_
 static int net_ctl_ro_header_perms(struct ctl_table_root *root,
 		struct nsproxy *namespaces, struct ctl_table *table)
 {
-	if (namespaces->net_ns == &init_net)
+	if (net_eq(namespaces->net_ns, &init_net))
 		return table->mode;
 	else
 		return table->mode & ~0222;

  reply	other threads:[~2009-03-09 18:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09 18:16 [RFC 0/4] netfilter conntrack sysctls pernet support Cyrill Gorcunov
2009-03-09 18:16 ` Cyrill Gorcunov [this message]
2009-03-09 18:16 ` [RFC 2/4] net: netfilter conntrack - add per-net functionality for DCCP protocol Cyrill Gorcunov
     [not found]   ` <49B63EA6.2060802@free.fr>
2009-03-10 10:33     ` Daniel Lezcano
2009-03-10 10:59       ` Cyrill Gorcunov
2009-03-10 11:35         ` Pavel Emelyanov
2009-03-10 11:51           ` Cyrill Gorcunov
2009-03-10 11:56             ` Pavel Emelyanov
2009-03-10 12:43             ` Daniel Lezcano
2009-03-10 11:25     ` David Miller
2009-03-10 13:02       ` Daniel Lezcano
2009-03-09 18:16 ` [RFC 3/4] net: netfilter conntrack - add per-net functionality for SCTP protocol Cyrill Gorcunov
2009-03-10 10:21   ` Daniel Lezcano
2009-03-09 18:16 ` [RFC 4/4] net: netfilter conntrack - add per-net functionality for UDPLITE protocol Cyrill Gorcunov
2009-03-09 18:47 ` [RFC 0/4] netfilter conntrack sysctls pernet support Patrick McHardy
2009-03-09 19:07   ` Cyrill Gorcunov
2009-03-09 21:08     ` Cyrill Gorcunov

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=20090309182731.621869188@gmail.com \
    --to=gorcunov@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gorcunov@openvz.org \
    --cc=kaber@trash.net \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).