Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Oct 2000 13:21:11 +0400 (MSD)
From:      yar@comp.chem.msu.su
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/22176: if_delmulti() doesn't notify the interface
Message-ID:  <200010210921.e9L9LBw00464@yar.chem.msu.su>

next in thread | raw e-mail | index | archive | help

>Number:         22176
>Category:       kern
>Synopsis:       if_delmulti() doesn't notify the interface
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 21 02:30:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Yar Tikhiy
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
Moscow State University
>Environment:

	The bug shows up in all branches.

>Description:

	The kernel if_delmulti() function is for removing multicast
	group addresses from an interface. After removing a link-layer
	address, an interface driver must be notified by calling
	its if_ioctl(), so it can rebuild hardware filters etc.

	However, if_delmulti() returns early and fails to notify
	a driver if an AF_LINK address has been removed. That
	happens because such an address usually doesn't have a
	helper ifma->ifma_addr->lladdr address (the pointer is
	null), unlike IP or other higher-level protocol multicasts.
	Noteably, ether_resolvemulti() sets "*llsa" to NULL when
	invoked on an AF_LINK address.

>How-To-Repeat:

	Join an ethernet muticast group from within kernel and then
	leave it using the if_addmulti()/if_delmulti() pair of
	functions. See the interface still recieving the multicasts
	(e.g. with the "tcpdump -p" command)

	I noticed that myself when debugging an ISL VLAN driver.

>Fix:

--- net/if.c.orig	Sat Oct 21 12:38:22 2000
+++ net/if.c	Sat Oct 21 12:46:32 2000
@@ -1278,6 +1278,12 @@
 	sa = ifma->ifma_lladdr;
 	s = splimp();
 	LIST_REMOVE(ifma, ifma_link);
+	/*
+	 * Make sure the interface driver is notified
+	 * if a link layer address has been removed.
+	 */
+	if (ifma->ifma_addr->sa_family == AF_LINK && sa == 0)
+		ifp->if_ioctl(ifp, SIOCDELMULTI, 0);
 	splx(s);
 	free(ifma->ifma_addr, M_IFMADDR);
 	free(ifma, M_IFMADDR);

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010210921.e9L9LBw00464>