Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/mld6.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet6/mld6.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.61 retrieving revision 1.65 diff -u -p -r1.61 -r1.65 --- src/sys/netinet6/mld6.c 2014/11/12 03:24:25 1.61 +++ src/sys/netinet6/mld6.c 2016/06/10 13:27:16 1.65 @@ -1,4 +1,4 @@ -/* $NetBSD: mld6.c,v 1.61 2014/11/12 03:24:25 ozaki-r Exp $ */ +/* $NetBSD: mld6.c,v 1.65 2016/06/10 13:27:16 ozaki-r Exp $ */ /* $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $ */ /* @@ -102,9 +102,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.61 2014/11/12 03:24:25 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.65 2016/06/10 13:27:16 ozaki-r Exp $"); +#ifdef _KERNEL_OPT #include "opt_inet.h" +#endif #include #include @@ -188,6 +190,7 @@ mld_init(void) ip6_opts.ip6po_hbh = hbh; /* We will specify the hoplimit by a multicast option. */ ip6_opts.ip6po_hlim = -1; + ip6_opts.ip6po_prefer_tempaddr = IP6PO_TEMPADDR_NOTPREFER; } static void @@ -591,7 +594,7 @@ mld_allocbuf(struct mbuf **mh, int len, (*mh)->m_next = md; md->m_next = NULL; - (*mh)->m_pkthdr.rcvif = NULL; + m_reset_rcvif((*mh)); (*mh)->m_pkthdr.len = sizeof(struct ip6_hdr) + len; (*mh)->m_len = sizeof(struct ip6_hdr); MH_ALIGN(*mh, sizeof(struct ip6_hdr)); @@ -655,8 +658,12 @@ in6_addmulti(struct in6_addr *maddr6, st in6m->in6m_ifp = ifp; in6m->in6m_refcount = 1; in6m->in6m_timer = IN6M_TIMER_UNDEF; + callout_init(&in6m->in6m_timer_ch, CALLOUT_MPSAFE); + callout_setfunc(&in6m->in6m_timer_ch, mld_timeo, in6m); + IFP_TO_IA6(ifp, ia); if (ia == NULL) { + callout_destroy(&in6m->in6m_timer_ch); free(in6m, M_IPMADDR); splx(s); *errorp = EADDRNOTAVAIL; /* appropriate? */ @@ -673,6 +680,7 @@ in6_addmulti(struct in6_addr *maddr6, st sockaddr_in6_init(&sin6, maddr6, 0, 0, 0); *errorp = if_mcast_op(ifp, SIOCADDMULTI, sin6tosa(&sin6)); if (*errorp) { + callout_destroy(&in6m->in6m_timer_ch); LIST_REMOVE(in6m, in6m_entry); free(in6m, M_IPMADDR); ifafree(&ia->ia_ifa); @@ -680,8 +688,6 @@ in6_addmulti(struct in6_addr *maddr6, st return (NULL); } - callout_init(&in6m->in6m_timer_ch, CALLOUT_MPSAFE); - callout_setfunc(&in6m->in6m_timer_ch, mld_timeo, in6m); in6m->in6m_timer = timer; if (in6m->in6m_timer > 0) { in6m->in6m_state = MLD_REPORTPENDING;