summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>1999-04-24 12:28:51 +0000
committerluigi <luigi@FreeBSD.org>1999-04-24 12:28:51 +0000
commit069fcdc17d94ed10da643f20d6ad91d603920377 (patch)
tree5eac631a1c8914c971c2a3129511a3c045ea3cd7
parent9b8660ce530031a730fd1ccb26e4a9ed8088e1a7 (diff)
downloadFreeBSD-src-069fcdc17d94ed10da643f20d6ad91d603920377.zip
FreeBSD-src-069fcdc17d94ed10da643f20d6ad91d603920377.tar.gz
postpone the sending of IGMP LEAVE msg to after deleting the
mc address from the address list. The latter operation on some hardware resets the card, potentially canceling the pending LEAVE pkt.
-rw-r--r--sys/netinet/in.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 9fe7095..0d0dbe9 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.c 8.4 (Berkeley) 1/9/95
- * $Id: in.c,v 1.38 1998/06/07 17:12:13 dfr Exp $
+ * $Id: in.c,v 1.39 1998/12/07 05:41:10 eivind Exp $
*/
#include <sys/param.h>
@@ -576,19 +576,25 @@ in_delmulti(inm)
register struct in_multi *inm;
{
struct ifmultiaddr *ifma = inm->inm_ifma;
+ struct in_multi my_inm;
int s = splnet();
+ my_inm.inm_ifp = NULL ; /* don't send the leave msg */
if (ifma->ifma_refcount == 1) {
/*
* No remaining claims to this record; let IGMP know that
* we are leaving the multicast group.
+ * But do it after the if_delmulti() which might reset
+ * the interface and nuke the packet.
*/
- igmp_leavegroup(inm);
+ my_inm = *inm ;
ifma->ifma_protospec = 0;
LIST_REMOVE(inm, inm_link);
free(inm, M_IPMADDR);
}
/* XXX - should be separate API for when we have an ifma? */
if_delmulti(ifma->ifma_ifp, ifma->ifma_addr);
+ if (my_inm.inm_ifp != NULL)
+ igmp_leavegroup(&my_inm);
splx(s);
}
OpenPOWER on IntegriCloud