From: mpi Date: Wed, 17 Dec 2014 09:45:59 +0000 (+0000) Subject: Use an interface index instead of a pointer for multicast options. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ec0be06b6d983c7080de92e271b00734845072fd;p=openbsd Use an interface index instead of a pointer for multicast options. Output interface (port) selection for multicast traffic is not done via route lookups. Instead the output ifp is registred when setsockopt(2) is called with the IP{V6,}_MULTICAST_IF option. But since there is no mechanism to invalidate such pointer stored in a pcb when an interface is destroyed/removed, it might lead your kernel to fault. Prevent a fault upon resume reported by frantisek holop, thanks! ok mikeb@, claudio@ --- diff --git a/sys/net/if.c b/sys/net/if.c index bcb7fbd613f..5008933b403 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.306 2014/12/08 10:46:14 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.307 2014/12/17 09:45:59 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -533,11 +533,6 @@ do { \ #endif #undef IF_DETACH_QUEUES - /* - * XXX transient ifp refs? inpcb.ip_moptions.imo_multicast_ifp? - * Other network stacks than INET? - */ - /* Remove the interface from the list of all interfaces. */ TAILQ_REMOVE(&ifnet, ifp, if_list); if (ISSET(ifp->if_xflags, IFXF_TXREADY)) diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 82500e09c98..0653b4cb8fa 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.212 2014/11/23 07:39:02 deraadt Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.213 2014/12/17 09:45:59 mpi Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -1354,7 +1354,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (imo->imo_num_memberships > 0) { in_delmulti(imo->imo_membership[ --imo->imo_num_memberships]); - imo->imo_multicast_ifp = NULL; + imo->imo_ifidx = 0; } splx(s); break; @@ -1379,7 +1379,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (imo->imo_num_memberships > 0) { in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); - imo->imo_multicast_ifp = NULL; + imo->imo_ifidx = 0; } if (sc->sc_sync_if && @@ -1401,7 +1401,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) return (ENOBUFS); } imo->imo_num_memberships++; - imo->imo_multicast_ifp = sc->sc_sync_if; + imo->imo_ifidx = sc->sc_sync_if->if_index; imo->imo_multicast_ttl = PFSYNC_DFLTTL; imo->imo_multicast_loop = 0; } diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 947e9d555e9..6e6b330ff65 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.17 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.18 2014/12/17 09:45:59 mpi Exp $ */ /* * Copyright (c) 2013 Reyk Floeter @@ -179,8 +179,9 @@ vxlan_multicast_cleanup(struct ifnet *ifp) { struct vxlan_softc *sc = (struct vxlan_softc *)ifp->if_softc; struct ip_moptions *imo = &sc->sc_imo; - struct ifnet *mifp = imo->imo_multicast_ifp; + struct ifnet *mifp; + mifp = if_get(imo->imo_ifidx); if (mifp != NULL) { if (sc->sc_ahcookie != NULL) { hook_disestablish(mifp->if_addrhooks, sc->sc_ahcookie); @@ -200,7 +201,7 @@ vxlan_multicast_cleanup(struct ifnet *ifp) if (imo->imo_num_memberships > 0) { in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); - imo->imo_multicast_ifp = NULL; + imo->imo_ifidx = 0; } } @@ -229,7 +230,7 @@ vxlan_multicast_join(struct ifnet *ifp, struct sockaddr_in *src, return (ENOBUFS); imo->imo_num_memberships++; - imo->imo_multicast_ifp = mifp; + imo->imo_ifidx = mifp->if_index; if (sc->sc_ttl > 0) imo->imo_multicast_ttl = sc->sc_ttl; else diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 81c56d62f5c..90254fc5cf1 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: igmp.c,v 1.46 2014/11/18 02:37:31 tedu Exp $ */ +/* $OpenBSD: igmp.c,v 1.47 2014/12/17 09:45:59 mpi Exp $ */ /* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */ /* @@ -641,7 +641,7 @@ igmp_sendpkt(struct in_multi *inm, int type, in_addr_t addr) m->m_data -= sizeof(struct ip); m->m_len += sizeof(struct ip); - imo.imo_multicast_ifp = if_get(inm->inm_ifidx); + imo.imo_ifidx = inm->inm_ifidx; imo.imo_multicast_ttl = 1; /* diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 11e0938837e..c31e90c5c36 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.164 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.165 2014/12/17 09:45:59 mpi Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -871,7 +871,7 @@ in_selectsrc(struct in_addr **insrc, struct sockaddr_in *sin, if (IN_MULTICAST(sin->sin_addr.s_addr) && mopts != NULL) { struct ifnet *ifp; - ifp = mopts->imo_multicast_ifp; + ifp = if_get(mopts->imo_ifidx); if (ifp != NULL) { if (ifp->if_rdomain == rtable_l2(rtableid)) IFP_TO_IA(ifp, ia); diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 9d823a6e119..fe32f214c5f 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.240 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.241 2014/12/17 09:45:59 mpi Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -1643,7 +1643,7 @@ carp_multicast_cleanup(struct carp_softc *sc) } } imo->imo_num_memberships = 0; - imo->imo_multicast_ifp = NULL; + imo->imo_ifidx = 0; #ifdef INET6 while (!LIST_EMPTY(&im6o->im6o_memberships)) { @@ -1653,7 +1653,7 @@ carp_multicast_cleanup(struct carp_softc *sc) LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } - im6o->im6o_multicast_ifp = NULL; + im6o->im6o_ifidx = 0; #endif /* And any other multicast memberships */ @@ -1930,7 +1930,7 @@ carp_join_multicast(struct carp_softc *sc) imo->imo_membership[0] = imm; imo->imo_num_memberships = 1; - imo->imo_multicast_ifp = &sc->sc_if; + imo->imo_ifidx = sc->sc_if.if_index; imo->imo_multicast_ttl = CARP_DFLTTL; imo->imo_multicast_loop = 0; return (0); @@ -2039,7 +2039,7 @@ carp_join_multicast6(struct carp_softc *sc) } /* apply v6 multicast membership */ - im6o->im6o_multicast_ifp = &sc->sc_if; + im6o->im6o_ifidx = sc->sc_if.if_index; if (imm) LIST_INSERT_HEAD(&im6o->im6o_memberships, imm, i6mm_chain); diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 3124e1e25cf..7370ffe58a6 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_mroute.c,v 1.72 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: ip_mroute.c,v 1.73 2014/12/17 09:45:59 mpi Exp $ */ /* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */ /* @@ -1653,7 +1653,7 @@ send_packet(struct vif *vifp, struct mbuf *m) */ struct ip_moptions imo; - imo.imo_multicast_ifp = vifp->v_ifp; + imo.imo_ifidx = vifp->v_ifp->if_index; imo.imo_multicast_ttl = mtod(m, struct ip *)->ip_ttl - IPTTLDEC; imo.imo_multicast_loop = 1; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 9d7fa320ff0..bb0b01d4f32 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.274 2014/12/08 10:51:00 mpi Exp $ */ +/* $OpenBSD: ip_output.c,v 1.275 2014/12/17 09:45:59 mpi Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -191,8 +191,7 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro, int flags, if ((IN_MULTICAST(ip->ip_dst.s_addr) || (ip->ip_dst.s_addr == INADDR_BROADCAST)) && - imo != NULL && imo->imo_multicast_ifp != NULL) { - ifp = imo->imo_multicast_ifp; + imo != NULL && (ifp = if_get(imo->imo_ifidx)) != NULL) { mtu = ifp->if_mtu; IFP_TO_IA(ifp, ia); } else { @@ -342,8 +341,7 @@ reroute: if ((IN_MULTICAST(ip->ip_dst.s_addr) || (ip->ip_dst.s_addr == INADDR_BROADCAST)) && - imo != NULL && imo->imo_multicast_ifp != NULL) { - ifp = imo->imo_multicast_ifp; + imo != NULL && (ifp = if_get(imo->imo_ifidx)) != NULL) { mtu = ifp->if_mtu; IFP_TO_IA(ifp, ia); } else { @@ -1679,7 +1677,7 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, (sizeof(*immp) * IP_MIN_MEMBERSHIPS), M_IPMOPTS, M_WAITOK|M_ZERO); *imop = imo; - imo->imo_multicast_ifp = NULL; + imo->imo_ifidx = 0; imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL; imo->imo_multicast_loop = IP_DEFAULT_MULTICAST_LOOP; imo->imo_num_memberships = 0; @@ -1704,7 +1702,7 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, * chosen every time a multicast packet is sent. */ if (addr.s_addr == INADDR_ANY) { - imo->imo_multicast_ifp = NULL; + imo->imo_ifidx = 0; break; } /* @@ -1723,7 +1721,7 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, error = EADDRNOTAVAIL; break; } - imo->imo_multicast_ifp = ifp; + imo->imo_ifidx = ifp->if_index; break; case IP_MULTICAST_TTL: @@ -1923,7 +1921,7 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, /* * If all options have default values, no need to keep the data. */ - if (imo->imo_multicast_ifp == NULL && + if (imo->imo_ifidx == 0 && imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL && imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP && imo->imo_num_memberships == 0) { @@ -1945,6 +1943,7 @@ ip_getmoptions(int optname, struct ip_moptions *imo, struct mbuf **mp) u_char *loop; struct in_addr *addr; struct in_ifaddr *ia; + struct ifnet *ifp; *mp = m_get(M_WAIT, MT_SOOPTS); @@ -1953,10 +1952,10 @@ ip_getmoptions(int optname, struct ip_moptions *imo, struct mbuf **mp) case IP_MULTICAST_IF: addr = mtod(*mp, struct in_addr *); (*mp)->m_len = sizeof(struct in_addr); - if (imo == NULL || imo->imo_multicast_ifp == NULL) + if (imo == NULL || (ifp = if_get(imo->imo_ifidx)) == NULL) addr->s_addr = INADDR_ANY; else { - IFP_TO_IA(imo->imo_multicast_ifp, ia); + IFP_TO_IA(ifp, ia); addr->s_addr = (ia == NULL) ? INADDR_ANY : ia->ia_addr.sin_addr.s_addr; } diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index c4abff43a44..c2dca5d0db3 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_var.h,v 1.57 2014/11/05 14:03:02 mpi Exp $ */ +/* $OpenBSD: ip_var.h,v 1.58 2014/12/17 09:45:59 mpi Exp $ */ /* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */ /* @@ -101,12 +101,12 @@ struct ipoption { * passed to ip_output when IP multicast options are in use. */ struct ip_moptions { - struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */ + struct in_multi **imo_membership; /* group memberships */ + unsigned short imo_ifidx; /* ifp index for outgoing multicasts */ u_int8_t imo_multicast_ttl; /* TTL for outgoing multicasts */ u_int8_t imo_multicast_loop; /* 1 => hear sends if a member */ u_int16_t imo_num_memberships; /* no. memberships this socket */ u_int16_t imo_max_memberships; /* max memberships this socket */ - struct in_multi **imo_membership; /* group memberships */ }; #include diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index f19dce62e86..aedab78a11f 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_src.c,v 1.49 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: in6_src.c,v 1.50 2014/12/17 09:45:59 mpi Exp $ */ /* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */ /* @@ -200,7 +200,7 @@ in6_selectsrc(struct in6_addr **in6src, struct sockaddr_in6 *dstsock, * choose a loopback interface as the outgoing interface. */ if (IN6_IS_ADDR_MULTICAST(dst)) { - ifp = mopts ? mopts->im6o_multicast_ifp : NULL; + ifp = mopts ? if_get(mopts->im6o_ifidx) : NULL; if (!ifp && dstsock->sin6_scope_id) ifp = if_get(htons(dstsock->sin6_scope_id)); @@ -345,7 +345,7 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, * interface for the address is specified by the caller, use it. */ if (IN6_IS_ADDR_MULTICAST(dst) && - mopts != NULL && (ifp = mopts->im6o_multicast_ifp) != NULL) { + mopts != NULL && (ifp = if_get(mopts->im6o_ifidx)) != NULL) { goto done; /* we do not need a route for multicast. */ } @@ -617,8 +617,7 @@ in6_embedscope(struct in6_addr *in6, const struct sockaddr_in6 *sin6, in6->s6_addr16[1] = htons(pi->ipi6_ifindex); } else if (in6p && IN6_IS_ADDR_MULTICAST(in6) && in6p->inp_moptions6 && - in6p->inp_moptions6->im6o_multicast_ifp) { - ifp = in6p->inp_moptions6->im6o_multicast_ifp; + (ifp = if_get(in6p->inp_moptions6->im6o_ifidx))) { in6->s6_addr16[1] = htons(ifp->if_index); } else if (scopeid) { ifp = if_get(scopeid); diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 7b33c20b650..0e62941c189 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1437,7 +1437,7 @@ phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m) if (m->m_pkthdr.rcvif == NULL) { struct ip6_moptions im6o; - im6o.im6o_multicast_ifp = ifp; + im6o.im6o_ifidx = ifp->if_index; /* XXX: ip6_output will override ip6->ip6_hlim */ im6o.im6o_multicast_hlim = ip6->ip6_hlim; im6o.im6o_multicast_loop = 1; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 12aa01ebffe..4e052947b12 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.163 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.164 2014/12/17 09:45:59 mpi Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -2329,7 +2329,7 @@ ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) if (im6o == NULL) return (ENOBUFS); *im6op = im6o; - im6o->im6o_multicast_ifp = NULL; + im6o->im6o_ifidx = 0; im6o->im6o_multicast_hlim = ip6_defmcasthlim; im6o->im6o_multicast_loop = IPV6_DEFAULT_MULTICAST_LOOP; LIST_INIT(&im6o->im6o_memberships); @@ -2359,7 +2359,7 @@ ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) break; } } - im6o->im6o_multicast_ifp = ifp; + im6o->im6o_ifidx = ifindex; break; case IPV6_MULTICAST_HOPS: @@ -2572,7 +2572,7 @@ ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) * If all options have default values, no need to keep the option * structure. */ - if (im6o->im6o_multicast_ifp == NULL && + if (im6o->im6o_ifidx == 0 && im6o->im6o_multicast_hlim == ip6_defmcasthlim && im6o->im6o_multicast_loop == IPV6_DEFAULT_MULTICAST_LOOP && LIST_EMPTY(&im6o->im6o_memberships)) { @@ -2598,10 +2598,10 @@ ip6_getmoptions(int optname, struct ip6_moptions *im6o, struct mbuf **mp) case IPV6_MULTICAST_IF: ifindex = mtod(*mp, u_int *); (*mp)->m_len = sizeof(u_int); - if (im6o == NULL || im6o->im6o_multicast_ifp == NULL) + if (im6o == NULL || im6o->im6o_ifidx == 0) *ifindex = 0; else - *ifindex = im6o->im6o_multicast_ifp->if_index; + *ifindex = im6o->im6o_ifidx; return (0); case IPV6_MULTICAST_HOPS: diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index fcbedc4af0d..371da75783b 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_var.h,v 1.49 2014/07/11 16:39:06 henning Exp $ */ +/* $OpenBSD: ip6_var.h,v 1.50 2014/12/17 09:45:59 mpi Exp $ */ /* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */ /* @@ -92,10 +92,10 @@ struct ip6asfrag { #define IP6_REASS_MBUF(ip6af) ((ip6af)->ip6af_m) struct ip6_moptions { - struct ifnet *im6o_multicast_ifp; /* ifp for outgoing multicasts */ + LIST_HEAD(, in6_multi_mship) im6o_memberships; + unsigned short im6o_ifidx; /* ifp index for outgoing multicasts */ u_char im6o_multicast_hlim; /* hoplimit for outgoing multicasts */ u_char im6o_multicast_loop; /* 1 >= hear sends if a member */ - LIST_HEAD(, in6_multi_mship) im6o_memberships; }; /* diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 1e0cc208b34..8364d591c38 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mld6.c,v 1.39 2014/11/18 02:37:31 tedu Exp $ */ +/* $OpenBSD: mld6.c,v 1.40 2014/12/17 09:45:59 mpi Exp $ */ /* $KAME: mld6.c,v 1.26 2001/02/16 14:50:35 itojun Exp $ */ /* @@ -438,7 +438,7 @@ mld6_sendpkt(struct in6_multi *in6m, int type, const struct in6_addr *dst) /* construct multicast option */ bzero(&im6o, sizeof(im6o)); - im6o.im6o_multicast_ifp = ifp; + im6o.im6o_ifidx = ifp->if_index; im6o.im6o_multicast_hlim = 1; /* diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index b08a9368aed..c3c488aa441 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_nbr.c,v 1.86 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: nd6_nbr.c,v 1.87 2014/12/17 09:45:59 mpi Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -398,7 +398,7 @@ nd6_ns_output(struct ifnet *ifp, struct in6_addr *daddr6, if (daddr6 == NULL || IN6_IS_ADDR_MULTICAST(daddr6)) { m->m_flags |= M_MCAST; - im6o.im6o_multicast_ifp = ifp; + im6o.im6o_ifidx = ifp->if_index; im6o.im6o_multicast_hlim = 255; im6o.im6o_multicast_loop = 0; } @@ -949,7 +949,7 @@ nd6_na_output(struct ifnet *ifp, struct in6_addr *daddr6, if (IN6_IS_ADDR_MULTICAST(daddr6)) { m->m_flags |= M_MCAST; - im6o.im6o_multicast_ifp = ifp; + im6o.im6o_ifidx = ifp->if_index; im6o.im6o_multicast_hlim = 255; im6o.im6o_multicast_loop = 0; } diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 0d24392c5e9..b5656990849 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.92 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.93 2014/12/17 09:45:59 mpi Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -202,7 +202,7 @@ nd6_rs_output(struct ifnet* ifp, struct in6_ifaddr *ia6) m->m_flags |= M_MCAST; m->m_pkthdr.csum_flags |= M_ICMP_CSUM_OUT; - im6o.im6o_multicast_ifp = ifp; + im6o.im6o_ifidx = ifp->if_index; im6o.im6o_multicast_hlim = 255; im6o.im6o_multicast_loop = 0;