Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/netinet6 Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/b721228019d5
branches:  netbsd-7
changeset: 798755:b721228019d5
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Dec 29 17:33:49 2014 +0000

description:
Pull up following revision(s) (requested by ozaki-r in ticket #360):
        sys/netinet6/mld6.c: revision 1.61
Ensure callout isn't running and pending before callout_destroy
Call callout_halt before callout_destroy. And also let callout (mld_timeo)
not call callout_schedule when we already called callout_halt.
This fixes PR 47881.

diffstat:

 sys/netinet6/mld6.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r bcf947e6d381 -r b721228019d5 sys/netinet6/mld6.c
--- a/sys/netinet6/mld6.c       Mon Dec 29 17:31:47 2014 +0000
+++ b/sys/netinet6/mld6.c       Mon Dec 29 17:33:49 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mld6.c,v 1.59 2014/07/26 22:21:16 joerg Exp $  */
+/*     $NetBSD: mld6.c,v 1.59.2.1 2014/12/29 17:33:49 martin Exp $     */
 /*     $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $   */
 
 /*
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.59 2014/07/26 22:21:16 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.59.2.1 2014/12/29 17:33:49 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -195,6 +195,8 @@
 {
        struct timeval now;
 
+       KASSERT(in6m->in6m_timer != IN6M_TIMER_UNDEF);
+
        microtime(&now);
        in6m->in6m_timer_expire.tv_sec = now.tv_sec + in6m->in6m_timer / hz;
        in6m->in6m_timer_expire.tv_usec = now.tv_usec +
@@ -227,6 +229,9 @@
        mutex_enter(softnet_lock);
        KERNEL_LOCK(1, NULL);
 
+       if (in6m->in6m_timer == IN6M_TIMER_UNDEF)
+               goto out;
+
        in6m->in6m_timer = IN6M_TIMER_UNDEF;
 
        switch (in6m->in6m_state) {
@@ -238,6 +243,7 @@
                break;
        }
 
+out:
        KERNEL_UNLOCK_ONE(NULL);
        mutex_exit(softnet_lock);
 }
@@ -741,7 +747,12 @@
                 */
                sockaddr_in6_init(&sin6, &in6m->in6m_addr, 0, 0, 0);
                if_mcast_op(in6m->in6m_ifp, SIOCDELMULTI, sin6tosa(&sin6));
+
+               /* Tell mld_timeo we're halting the timer */
+               in6m->in6m_timer = IN6M_TIMER_UNDEF;
+               callout_halt(&in6m->in6m_timer_ch, softnet_lock);
                callout_destroy(&in6m->in6m_timer_ch);
+
                free(in6m, M_IPMADDR);
        }
        splx(s);



Home | Main Index | Thread Index | Old Index