summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Stevens <dlstevens@us.ibm.com>2004-02-16 06:49:24 -0800
committerDavid S. Miller <davem@nuts.davemloft.net>2004-02-16 06:49:24 -0800
commitfdd2f9fbb05c87643c463d557e3babb2f4d2a3d3 (patch)
treeeae3551aaac830091b942d8a1588f77bb8128994
parent091a8aa4ba0278fe28380096822b2890a832defe (diff)
[IPV6]: Add sysctl to force MLD version.
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--net/ipv6/addrconf.c12
-rw-r--r--net/ipv6/mcast.c6
4 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 29911bf4218e..e98637f35817 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -136,6 +136,7 @@ struct ipv6_devconf {
__s32 rtr_solicits;
__s32 rtr_solicit_interval;
__s32 rtr_solicit_delay;
+ __s32 force_mld_version;
#ifdef CONFIG_IPV6_PRIVACY
__s32 use_tempaddr;
__s32 temp_valid_lft;
@@ -165,6 +166,7 @@ enum {
DEVCONF_REGEN_MAX_RETRY,
DEVCONF_MAX_DESYNC_FACTOR,
DEVCONF_MAX_ADDRESSES,
+ DEVCONF_FORCE_MLD_VERSION,
DEVCONF_MAX
};
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index cab2610aa003..8085f0e55513 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -424,7 +424,8 @@ enum {
NET_IPV6_TEMP_PREFERED_LFT=13,
NET_IPV6_REGEN_MAX_RETRY=14,
NET_IPV6_MAX_DESYNC_FACTOR=15,
- NET_IPV6_MAX_ADDRESSES=16
+ NET_IPV6_MAX_ADDRESSES=16,
+ NET_IPV6_FORCE_MLD_VERSION=17
};
/* /proc/sys/net/ipv6/icmp */
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c8e6d980236b..a4673092a2a4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -149,6 +149,7 @@ struct ipv6_devconf ipv6_devconf = {
.accept_ra = 1,
.accept_redirects = 1,
.autoconf = 1,
+ .force_mld_version = 0,
.dad_transmits = 1,
.rtr_solicits = MAX_RTR_SOLICITATIONS,
.rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
@@ -2739,6 +2740,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf,
array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits;
array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval;
array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay;
+ array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version;
#ifdef CONFIG_IPV6_PRIVACY
array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr;
array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft;
@@ -3042,7 +3044,7 @@ static int addrconf_sysctl_forward_strategy(ctl_table *table,
static struct addrconf_sysctl_table
{
struct ctl_table_header *sysctl_header;
- ctl_table addrconf_vars[17];
+ ctl_table addrconf_vars[18];
ctl_table addrconf_dev[2];
ctl_table addrconf_conf_dir[2];
ctl_table addrconf_proto_dir[2];
@@ -3133,6 +3135,14 @@ static struct addrconf_sysctl_table
.proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies,
},
+ {
+ .ctl_name = NET_IPV6_FORCE_MLD_VERSION,
+ .procname = "force_mld_version",
+ .data = &ipv6_devconf.force_mld_version,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
#ifdef CONFIG_IPV6_PRIVACY
{
.ctl_name = NET_IPV6_USE_TEMPADDR,
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index f05b25c6398a..daad690f9927 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -152,8 +152,10 @@ int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
#define IGMP6_UNSOLICITED_IVAL (10*HZ)
#define MLD_QRV_DEFAULT 2
-#define MLD_V1_SEEN(idev) ((idev)->mc_v1_seen && \
- time_before(jiffies, (idev)->mc_v1_seen))
+#define MLD_V1_SEEN(idev) (ipv6_devconf.force_mld_version == 1 || \
+ (idev)->cnf.force_mld_version == 1 || \
+ ((idev)->mc_v1_seen && \
+ time_before(jiffies, (idev)->mc_v1_seen)))
#define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
#define MLDV2_EXP(thresh, nbmant, nbexp, value) \