aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2014-09-02 09:49:25 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-05 01:26:14 -0400
commit2f711939d2ea9dfaecebecd1324d2ec7a7a21f65 (patch)
treebd60e72acdcced3d345139cb31540b586eabd5a1 /net/ipv6/mcast.c
parentb89df95d52d5fd0de5a2ca3f8b49aaaee4675151 (diff)
ipv6: add sysctl_mld_qrv to configure query robustness variable
This patch adds a new sysctl_mld_qrv knob to configure the mldv1/v2 query robustness variable. It specifies how many retransmit of unsolicited mld retransmit should happen. Admins might want to tune this on lossy links. Also reset mld state on interface down/up, so we pick up new sysctl settings during interface up event. IPv6 certification requests this knob to be available. I didn't make this knob netns specific, as it is mostly a setting in a physical environment and should be per host. Cc: Flavio Leitner <fbl@redhat.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Acked-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 70881795da96..64919425f1ab 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -121,6 +121,7 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
121#define IPV6_MLD_MAX_MSF 64 121#define IPV6_MLD_MAX_MSF 64
122 122
123int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF; 123int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
124int sysctl_mld_qrv __read_mostly = MLD_QRV_DEFAULT;
124 125
125/* 126/*
126 * socket join on multicast group 127 * socket join on multicast group
@@ -1191,15 +1192,16 @@ static void mld_update_qrv(struct inet6_dev *idev,
1191 * and SHOULD NOT be one. Catch this here if we ever run 1192 * and SHOULD NOT be one. Catch this here if we ever run
1192 * into such a case in future. 1193 * into such a case in future.
1193 */ 1194 */
1195 const int min_qrv = min(MLD_QRV_DEFAULT, sysctl_mld_qrv);
1194 WARN_ON(idev->mc_qrv == 0); 1196 WARN_ON(idev->mc_qrv == 0);
1195 1197
1196 if (mlh2->mld2q_qrv > 0) 1198 if (mlh2->mld2q_qrv > 0)
1197 idev->mc_qrv = mlh2->mld2q_qrv; 1199 idev->mc_qrv = mlh2->mld2q_qrv;
1198 1200
1199 if (unlikely(idev->mc_qrv < 2)) { 1201 if (unlikely(idev->mc_qrv < min_qrv)) {
1200 net_warn_ratelimited("IPv6: MLD: clamping QRV from %u to %u!\n", 1202 net_warn_ratelimited("IPv6: MLD: clamping QRV from %u to %u!\n",
1201 idev->mc_qrv, MLD_QRV_DEFAULT); 1203 idev->mc_qrv, min_qrv);
1202 idev->mc_qrv = MLD_QRV_DEFAULT; 1204 idev->mc_qrv = min_qrv;
1203 } 1205 }
1204} 1206}
1205 1207
@@ -2478,6 +2480,14 @@ void ipv6_mc_down(struct inet6_dev *idev)
2478 mld_clear_delrec(idev); 2480 mld_clear_delrec(idev);
2479} 2481}
2480 2482
2483static void ipv6_mc_reset(struct inet6_dev *idev)
2484{
2485 idev->mc_qrv = sysctl_mld_qrv;
2486 idev->mc_qi = MLD_QI_DEFAULT;
2487 idev->mc_qri = MLD_QRI_DEFAULT;
2488 idev->mc_v1_seen = 0;
2489 idev->mc_maxdelay = unsolicited_report_interval(idev);
2490}
2481 2491
2482/* Device going up */ 2492/* Device going up */
2483 2493
@@ -2488,6 +2498,7 @@ void ipv6_mc_up(struct inet6_dev *idev)
2488 /* Install multicast list, except for all-nodes (already installed) */ 2498 /* Install multicast list, except for all-nodes (already installed) */
2489 2499
2490 read_lock_bh(&idev->lock); 2500 read_lock_bh(&idev->lock);
2501 ipv6_mc_reset(idev);
2491 for (i = idev->mc_list; i; i = i->next) 2502 for (i = idev->mc_list; i; i = i->next)
2492 igmp6_group_added(i); 2503 igmp6_group_added(i);
2493 read_unlock_bh(&idev->lock); 2504 read_unlock_bh(&idev->lock);
@@ -2508,13 +2519,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
2508 (unsigned long)idev); 2519 (unsigned long)idev);
2509 setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire, 2520 setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire,
2510 (unsigned long)idev); 2521 (unsigned long)idev);
2511 2522 ipv6_mc_reset(idev);
2512 idev->mc_qrv = MLD_QRV_DEFAULT;
2513 idev->mc_qi = MLD_QI_DEFAULT;
2514 idev->mc_qri = MLD_QRI_DEFAULT;
2515
2516 idev->mc_maxdelay = unsolicited_report_interval(idev);
2517 idev->mc_v1_seen = 0;
2518 write_unlock_bh(&idev->lock); 2523 write_unlock_bh(&idev->lock);
2519} 2524}
2520 2525