From c7323482f49998589b6b5e29d16bd41744cfbfab Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Wed, 12 Aug 1998 22:51:59 +0000 Subject: [PATCH] One-liner: add a call to the underlying device driver's SIOCDELMULTI ioctl() routine at the end of if_delmulti() so that interfaces with hardware multicast filtering can update their filters in a timely manner. If the interface doesn't support hardware multicast filtering, then reception of multicast frames is done using 'promiscious mode' or 'capture all multicast frames' mode and software filtering in the kernel. In this case, it doesn't matter if if_delmulti() ever does an SCIODELMULTI on the interface or not: if MULTICAST support is enabled, then we join the 'all hosts' group when the interface is configured, and remain in it until the interface is brought down. Without hardware filtering, joining one group means joining all groups, so it makes no difference if we call the SIOCDELMULTI routine. If the interface does support hardware multicast filtering, then by not reprogramming the hardware filter in if_delmulti(), we have to wait until somebody calls if_setmulti(), during which time the interface is receiving frames for multicast groups in which we are no longer interested. --- sys/net/if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/if.c b/sys/net/if.c index 56b9ae8ba10a..295ae4d23058 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.60 1998/06/08 20:33:29 julian Exp $ + * $Id: if.c,v 1.61 1998/07/20 13:21:56 dfr Exp $ */ #include "opt_compat.h" @@ -1031,6 +1031,7 @@ if_delmulti(ifp, sa) s = splimp(); LIST_REMOVE(ifma, ifma_link); + ifp->if_ioctl(ifp, SIOCDELMULTI, 0); splx(s); free(ifma->ifma_addr, M_IFMADDR); free(sa, M_IFMADDR);