ipv6: make unsolicited report intervals configurable for mld
Commitcab70040df
("net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3") and2690048c01
("net: igmp: Allow user-space configuration of igmp unsolicited report interval") by William Manley made igmp unsolicited report intervals configurable per interface and corrected the interval of unsolicited igmpv3 report messages resendings to 1s. Same needs to be done for IPv6: MLDv1 (RFC2710 7.10.): 10 seconds MLDv2 (RFC3810 9.11.): 1 second Both intervals are configurable via new procfs knobs mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval. (also added .force_mld_version to ipv6_devconf_dflt to bring structs in line without semantic changes) v2: a) Joined documentation update for IPv4 and IPv6 MLD/IGMP unsolicited_report_interval procfs knobs. b) incorporate stylistic feedback from William Manley v3: a) add new DEVCONF_* values to the end of the enum (thanks to David Miller) Cc: Cong Wang <xiyou.wangcong@gmail.com> Cc: William Manley <william.manley@youview.com> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
74c181d528
commit
fc4eba58b4
@@ -108,7 +108,6 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
|
||||
struct inet6_dev *idev);
|
||||
|
||||
|
||||
#define IGMP6_UNSOLICITED_IVAL (10*HZ)
|
||||
#define MLD_QRV_DEFAULT 2
|
||||
|
||||
#define MLD_V1_SEEN(idev) (dev_net((idev)->dev)->ipv6.devconf_all->force_mld_version == 1 || \
|
||||
@@ -129,6 +128,18 @@ int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
|
||||
pmc != NULL; \
|
||||
pmc = rcu_dereference(pmc->next))
|
||||
|
||||
static int unsolicited_report_interval(struct inet6_dev *idev)
|
||||
{
|
||||
int iv;
|
||||
|
||||
if (MLD_V1_SEEN(idev))
|
||||
iv = idev->cnf.mldv1_unsolicited_report_interval;
|
||||
else
|
||||
iv = idev->cnf.mldv2_unsolicited_report_interval;
|
||||
|
||||
return iv > 0 ? iv : 1;
|
||||
}
|
||||
|
||||
int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
|
||||
{
|
||||
struct net_device *dev = NULL;
|
||||
@@ -2158,7 +2169,7 @@ static void igmp6_join_group(struct ifmcaddr6 *ma)
|
||||
|
||||
igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT);
|
||||
|
||||
delay = net_random() % IGMP6_UNSOLICITED_IVAL;
|
||||
delay = net_random() % unsolicited_report_interval(ma->idev);
|
||||
|
||||
spin_lock_bh(&ma->mca_lock);
|
||||
if (del_timer(&ma->mca_timer)) {
|
||||
@@ -2325,7 +2336,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
|
||||
setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire,
|
||||
(unsigned long)idev);
|
||||
idev->mc_qrv = MLD_QRV_DEFAULT;
|
||||
idev->mc_maxdelay = IGMP6_UNSOLICITED_IVAL;
|
||||
idev->mc_maxdelay = unsolicited_report_interval(idev);
|
||||
idev->mc_v1_seen = 0;
|
||||
write_unlock_bh(&idev->lock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user