]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: fix FreeBSD IPv6 multicast group join race
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Sat, 26 Jan 2019 15:49:35 +0000 (13:49 -0200)
committerMartin Winter <mwinter@opensourcerouting.org>
Sun, 2 Jun 2019 14:50:29 +0000 (16:50 +0200)
Avoid a IPv6 multicast group join race by delaying the group install
before processing all event queue.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit bc482dc0caeed76505623426edf58c6de48f013e)

ospf6d/ospf6_interface.c

index 9aafb6d813f2ccce74a61e910195732658a59d9a..c56b1eae1972be71a40013b22fca623e19e0f3ad 100644 (file)
@@ -729,6 +729,22 @@ int interface_up(struct thread *thread)
                return 0;
        }
 
+#ifdef __FreeBSD__
+       /*
+        * XXX: Schedule IPv6 group join for later, otherwise we might
+        * lose the multicast group registration caused by IPv6 group
+        * leave race.
+        */
+       if (oi->sso_try_cnt == 0) {
+               oi->sso_try_cnt++;
+               zlog_info("Scheduling %s for sso", oi->interface->name);
+               thread_add_timer(master, interface_up, oi,
+                                OSPF6_INTERFACE_SSO_RETRY_INT,
+                                &oi->thread_sso);
+               return 0;
+       }
+#endif /* __FreeBSD__ */
+
        /* Join AllSPFRouters */
        if (ospf6_sso(oi->interface->ifindex, &allspfrouters6, IPV6_JOIN_GROUP)
            < 0) {