From: Daniel Lezcano <dlezcano@fr.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [patch 7/9][NETNS][IPV6] make mld_max_msf per namespace
Date: Wed, 02 Jan 2008 13:25:55 +0100 [thread overview]
Message-ID: <20080102122827.779444823@localhost.localdomain> (raw)
In-Reply-To: 20080102122548.629622062@localhost.localdomain
[-- Attachment #1: move-mld_max_msf-to-netns.patch --]
[-- Type: text/plain, Size: 4074 bytes --]
The mld_max_msf variable is moved to the network namespace structure.
A helper function has been added to initialize the variable.
Because the ipv6 protocol is not yet per namespace, the variable is
accessed relatively from the initial network namespace.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
---
include/net/ipv6.h | 3 ---
include/net/netns/ipv6.h | 1 +
net/ipv6/ipv6_sockglue.c | 3 +--
net/ipv6/mcast.c | 9 ++++++---
net/ipv6/sysctl_net_ipv6.c | 5 ++++-
5 files changed, 12 insertions(+), 9 deletions(-)
Index: net-2.6.25/include/net/ipv6.h
===================================================================
--- net-2.6.25.orig/include/net/ipv6.h
+++ net-2.6.25/include/net/ipv6.h
@@ -108,9 +108,6 @@ struct frag_hdr {
#include <net/sock.h>
-/* sysctls */
-extern int sysctl_mld_max_msf;
-
#define _DEVINC(statname, modifier, idev, field) \
({ \
struct inet6_dev *_idev = (idev); \
Index: net-2.6.25/include/net/netns/ipv6.h
===================================================================
--- net-2.6.25.orig/include/net/netns/ipv6.h
+++ net-2.6.25/include/net/netns/ipv6.h
@@ -13,6 +13,7 @@ struct netns_sysctl_ipv6 {
struct ctl_table_header *table;
struct inet_frags_ctl frags;
int bindv6only;
+ int mld_max_msf;
};
struct netns_ipv6 {
Index: net-2.6.25/net/ipv6/ipv6_sockglue.c
===================================================================
--- net-2.6.25.orig/net/ipv6/ipv6_sockglue.c
+++ net-2.6.25/net/ipv6/ipv6_sockglue.c
@@ -656,7 +656,6 @@ done:
}
case MCAST_MSFILTER:
{
- extern int sysctl_mld_max_msf;
struct group_filter *gsf;
if (optlen < GROUP_FILTER_SIZE(0))
@@ -677,7 +676,7 @@ done:
}
/* numsrc >= (4G-140)/128 overflow in 32 bits */
if (gsf->gf_numsrc >= 0x1ffffffU ||
- gsf->gf_numsrc > sysctl_mld_max_msf) {
+ gsf->gf_numsrc > init_net.ipv6.sysctl.mld_max_msf) {
kfree(gsf);
retv = -ENOBUFS;
break;
Index: net-2.6.25/net/ipv6/mcast.c
===================================================================
--- net-2.6.25.orig/net/ipv6/mcast.c
+++ net-2.6.25/net/ipv6/mcast.c
@@ -172,8 +172,6 @@ static int ip6_mc_leave_src(struct sock
#define IPV6_MLD_MAX_MSF 64
-int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
-
/*
* socket join on multicast group
*/
@@ -441,7 +439,7 @@ int ip6_mc_source(int add, int omode, st
}
/* else, add a new source to the filter */
- if (psl && psl->sl_count >= sysctl_mld_max_msf) {
+ if (psl && psl->sl_count >= init_net.ipv6.sysctl.mld_max_msf) {
err = -ENOBUFS;
goto done;
}
@@ -2597,6 +2595,11 @@ static const struct file_operations igmp
};
#endif
+void igmp6_sysctl_init(struct net *net)
+{
+ net->ipv6.sysctl.mld_max_msf = IPV6_MLD_MAX_MSF;
+}
+
int __init igmp6_init(struct net_proto_family *ops)
{
struct ipv6_pinfo *np;
Index: net-2.6.25/net/ipv6/sysctl_net_ipv6.c
===================================================================
--- net-2.6.25.orig/net/ipv6/sysctl_net_ipv6.c
+++ net-2.6.25/net/ipv6/sysctl_net_ipv6.c
@@ -17,6 +17,7 @@
extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
extern void ipv6_frag_sysctl_init(struct net *net);
+extern void igmp6_sysctl_init(struct net *net);
static ctl_table ipv6_table_template[] = {
{
@@ -78,7 +79,7 @@ static ctl_table ipv6_table_template[] =
{
.ctl_name = NET_IPV6_MLD_MAX_MSF,
.procname = "mld_max_msf",
- .data = &sysctl_mld_max_msf,
+ .data = &init_net.ipv6.sysctl.mld_max_msf,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
@@ -121,8 +122,10 @@ static int ipv6_sysctl_net_init(struct n
ipv6_table[4].data = &net->ipv6.sysctl.frags.low_thresh;
ipv6_table[5].data = &net->ipv6.sysctl.frags.timeout;
ipv6_table[6].data = &net->ipv6.sysctl.frags.secret_interval;
+ ipv6_table[7].data = &net->ipv6.sysctl.mld_max_msf;
ipv6_frag_sysctl_init(net);
+ igmp6_sysctl_init(net);
net->ipv6.sysctl.bindv6only = 0;
--
next prev parent reply other threads:[~2008-01-02 12:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-02 12:25 [patch 0/9][NETNS][IPV6] make sysctl per namespace Daniel Lezcano
2008-01-02 12:25 ` [patch 1/9][NETNS][IPV6] make ipv6_sysctl_register to return a value Daniel Lezcano
2008-01-02 12:25 ` [patch 2/9][NETNS][IPV6] make the ipv6 sysctl to be a netns subsystem Daniel Lezcano
2008-01-02 12:25 ` [patch 3/9][NETNS][IPV6] make ipv6 structure for netns Daniel Lezcano
2008-01-02 12:25 ` [patch 4/9][NETNS][IPV6] make multiple instance of sysctl tables Daniel Lezcano
2008-01-02 12:25 ` [patch 5/9][NETNS][IPV6] make bindv6only sysctl per namespace Daniel Lezcano
2008-01-02 12:25 ` [patch 6/9][NETNS][IPV6] make ip6_frags " Daniel Lezcano
2008-01-02 12:25 ` Daniel Lezcano [this message]
2008-01-02 23:31 ` [patch 7/9][NETNS][IPV6] make mld_max_msf " David Stevens
2008-01-03 11:00 ` Daniel Lezcano
2008-01-03 17:05 ` David Stevens
2008-01-02 12:25 ` [patch 8/9][NETNS][IPV6] make sysctls route " Daniel Lezcano
2008-01-02 12:25 ` [patch 9/9][NETNS][IPV6] make icmpv6_time sysctl " Daniel Lezcano
2008-01-02 13:54 ` [patch 0/9][NETNS][IPV6] make " Eric Dumazet
2008-01-02 14:05 ` Daniel Lezcano
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=20080102122827.779444823@localhost.localdomain \
--to=dlezcano@fr.ibm.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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).