]> Pileus Git - ~andy/linux/blobdiff - net/ipv4/igmp.c
bonding: Improve IGMP join processing
[~andy/linux] / net / ipv4 / igmp.c
index b8e1625d34cfe2de876c99b095679d1956c9191f..1c6a084b5fb7adf9e4a77e9b1227afc97082b117 100644 (file)
@@ -1250,6 +1250,28 @@ out:
        return;
 }
 
+/*
+ *     Resend IGMP JOIN report; used for bonding.
+ */
+void ip_mc_rejoin_group(struct ip_mc_list *im)
+{
+       struct in_device *in_dev = im->interface;
+
+#ifdef CONFIG_IP_MULTICAST
+       if (im->multiaddr == IGMP_ALL_HOSTS)
+               return;
+
+       if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) {
+               igmp_mod_timer(im, IGMP_Initial_Report_Delay);
+               return;
+       }
+       /* else, v3 */
+       im->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
+               IGMP_Unsolicited_Report_Count;
+       igmp_ifc_event(in_dev);
+#endif
+}
+
 /*
  *     A socket has left a multicast group on device dev
  */
@@ -2403,7 +2425,7 @@ out_kfree:
        goto out;
 }
 
-static struct file_operations igmp_mc_seq_fops = {
+static const struct file_operations igmp_mc_seq_fops = {
        .owner          =       THIS_MODULE,
        .open           =       igmp_mc_seq_open,
        .read           =       seq_read,
@@ -2577,7 +2599,7 @@ out_kfree:
        goto out;
 }
 
-static struct file_operations igmp_mcf_seq_fops = {
+static const struct file_operations igmp_mcf_seq_fops = {
        .owner          =       THIS_MODULE,
        .open           =       igmp_mcf_seq_open,
        .read           =       seq_read,
@@ -2596,3 +2618,4 @@ int __init igmp_mc_proc_init(void)
 EXPORT_SYMBOL(ip_mc_dec_group);
 EXPORT_SYMBOL(ip_mc_inc_group);
 EXPORT_SYMBOL(ip_mc_join_group);
+EXPORT_SYMBOL(ip_mc_rejoin_group);