diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-11-12 18:01:44 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-11-12 18:01:44 +0000 |
commit | 82c7ffc882d325954cf271f195c8be24dd7fe26c (patch) | |
tree | 40ddf5859e06e796440323d58e403a3ce36090a7 | |
parent | 3fdad9db1764f803b4d243c86b8d24ca5b75be25 (diff) |
Do not try to guess if there's still an IPv4 multicast routing daemon
using an interface based on the value of ``ip_mrouter''.
Calling SIOCDELMULTI on an interface is correct even if such daemon is
running because the Ethernet layer refcounts currently joined multicast
groups.
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index fddfc738336..05fb95fb4f9 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -133,14 +133,12 @@ struct mrt6stat mrt6stat; struct mf6c *mf6ctable[MF6CTBLSIZ]; SIPHASH_KEY mf6chashkey; u_char n6expire[MF6CTBLSIZ]; -struct mif6 mif6table[MAXMIFS]; +struct mif6 mif6table[MAXMIFS]; void expire_upcalls6(void *); #define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */ #define UPCALL_EXPIRE 6 /* number of timeouts */ -extern struct socket *ip_mrouter; - /* * 'Interfaces' associated with decapsulator (so we can tell * packets that went through it from ones that get reflected @@ -522,32 +520,24 @@ ip6_mrouter_done(void) * For each phyint in use, disable promiscuous reception of all IPv6 * multicasts. */ - /* - * If there is still IPv4 multicast routing daemon, - * we remain interfaces to receive all muliticasted packets. - * XXX: there may be an interface in which the IPv4 multicast - * daemon is not interested... - */ - if (!ip_mrouter) { - for (mifi = 0; mifi < nummifs; mifi++) { - if (mif6table[mifi].m6_ifp == NULL) - continue; + for (mifi = 0; mifi < nummifs; mifi++) { + if (mif6table[mifi].m6_ifp == NULL) + continue; - if (!(mif6table[mifi].m6_flags & MIFF_REGISTER)) { - memset(&ifr, 0, sizeof(ifr)); - ifr.ifr_addr.sin6_family = AF_INET6; - ifr.ifr_addr.sin6_addr= in6addr_any; - ifp = mif6table[mifi].m6_ifp; - (*ifp->if_ioctl)(ifp, SIOCDELMULTI, - (caddr_t)&ifr); - } else { - /* Reset register interface */ - if (reg_mif_num != (mifi_t)-1) { - if_detach(ifp); - free(ifp, M_DEVBUF, sizeof(*ifp)); - reg_mif_num = (mifi_t)-1; - reg_mif_idx = 0; - } + if (!(mif6table[mifi].m6_flags & MIFF_REGISTER)) { + memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_addr.sin6_family = AF_INET6; + ifr.ifr_addr.sin6_addr= in6addr_any; + ifp = mif6table[mifi].m6_ifp; + (*ifp->if_ioctl)(ifp, SIOCDELMULTI, + (caddr_t)&ifr); + } else { + /* Reset register interface */ + if (reg_mif_num != (mifi_t)-1) { + if_detach(ifp); + free(ifp, M_DEVBUF, sizeof(*ifp)); + reg_mif_num = (mifi_t)-1; + reg_mif_idx = 0; } } } |