Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88bbce78 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ipv6: make unsolicited report intervals configurable for mld"

parents 995e7f46 2809cb4d
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -1038,7 +1038,15 @@ disable_policy - BOOLEAN
disable_xfrm - BOOLEAN
	Disable IPSEC encryption on this interface, whatever the policy

igmpv2_unsolicited_report_interval - INTEGER
	The interval in milliseconds in which the next unsolicited
	IGMPv1 or IGMPv2 report retransmit will take place.
	Default: 10000 (10 seconds)

igmpv3_unsolicited_report_interval - INTEGER
	The interval in milliseconds in which the next unsolicited
	IGMPv3 report retransmit will take place.
	Default: 1000 (1 seconds)

tag - INTEGER
	Allows you to write a number, which can be used as required.
@@ -1376,6 +1384,15 @@ use_optimistic - BOOLEAN
	address selection algorithm.
		0: disabled (default)
		1: enabled
mldv1_unsolicited_report_interval - INTEGER
	The interval in milliseconds in which the next unsolicited
	MLDv1 report retransmit will take place.
	Default: 10000 (10 seconds)

mldv2_unsolicited_report_interval - INTEGER
	The interval in milliseconds in which the next unsolicited
	MLDv2 report retransmit will take place.
	Default: 1000 (1 second)

icmp/*:
ratelimit - INTEGER
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ struct ipv6_devconf {
	__s32		rtr_solicit_interval;
	__s32		rtr_solicit_delay;
	__s32		force_mld_version;
	__s32		mldv1_unsolicited_report_interval;
	__s32		mldv2_unsolicited_report_interval;
#ifdef CONFIG_IPV6_PRIVACY
	__s32		use_tempaddr;
	__s32		temp_valid_lft;
+2 −0
Original line number Diff line number Diff line
@@ -165,6 +165,8 @@ enum {
	DEVCONF_ACCEPT_RA_MTU,
	DEVCONF_USE_OPTIMISTIC,
	DEVCONF_USE_OIF_ADDRS_ONLY,
	DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
	DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
	DEVCONF_MAX
};

+25 −0
Original line number Diff line number Diff line
@@ -179,6 +179,8 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
	.accept_redirects	= 1,
	.autoconf		= 1,
	.force_mld_version	= 0,
	.mldv1_unsolicited_report_interval = 10 * HZ,
	.mldv2_unsolicited_report_interval = HZ,
	.dad_transmits		= 1,
	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
@@ -217,6 +219,9 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
	.accept_ra		= 1,
	.accept_redirects	= 1,
	.autoconf		= 1,
	.force_mld_version	= 0,
	.mldv1_unsolicited_report_interval = 10 * HZ,
	.mldv2_unsolicited_report_interval = HZ,
	.dad_transmits		= 1,
	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
@@ -4263,6 +4268,10 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
	array[DEVCONF_RTR_SOLICIT_DELAY] =
		jiffies_to_msecs(cnf->rtr_solicit_delay);
	array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version;
	array[DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL] =
		jiffies_to_msecs(cnf->mldv1_unsolicited_report_interval);
	array[DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL] =
		jiffies_to_msecs(cnf->mldv2_unsolicited_report_interval);
#ifdef CONFIG_IPV6_PRIVACY
	array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr;
	array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft;
@@ -4910,6 +4919,22 @@ static struct addrconf_sysctl_table
			.mode		= 0644,
			.proc_handler	= proc_dointvec,
		},
		{
			.procname	= "mldv1_unsolicited_report_interval",
			.data		=
				&ipv6_devconf.mldv1_unsolicited_report_interval,
			.maxlen		= sizeof(int),
			.mode		= 0644,
			.proc_handler	= proc_dointvec_ms_jiffies,
		},
		{
			.procname	= "mldv2_unsolicited_report_interval",
			.data		=
				&ipv6_devconf.mldv2_unsolicited_report_interval,
			.maxlen		= sizeof(int),
			.mode		= 0644,
			.proc_handler	= proc_dointvec_ms_jiffies,
		},
#ifdef CONFIG_IPV6_PRIVACY
		{
			.procname	= "use_tempaddr",
+14 −3
Original line number Diff line number Diff line
@@ -107,7 +107,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 || \
@@ -128,6 +127,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;
@@ -2108,7 +2119,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)) {
@@ -2271,7 +2282,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
	setup_timer(&idev->mc_ifc_timer, mld_ifc_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);
}