From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 1 06:23:35 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 68CFE2E0; Fri, 1 Feb 2013 06:23:35 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0FFD3F; Fri, 1 Feb 2013 06:23:34 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r116NRCo059212; Fri, 1 Feb 2013 06:23:27 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id hfvkn86myvzupfitr7f2pvrxui; Fri, 01 Feb 2013 06:23:27 +0000 (UTC) (envelope-from tim@kientzle.com) Subject: Re: Testing SIOCADDMULTI? Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=windows-1252 From: Tim Kientzle In-Reply-To: <201301281109.24879.jhb@freebsd.org> Date: Thu, 31 Jan 2013 22:23:26 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <965B76D3-8BE8-4DA1-8A48-D22238490D03@kientzle.com> References: <7A0E9B71-0232-4808-B5D4-5B0D811B353C@kientzle.com> <201301281109.24879.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1283) Cc: freebsd-hackers@FreeBSD.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 06:23:35 -0000 On Jan 28, 2013, at 8:09 AM, John Baldwin wrote: > On Sunday, January 27, 2013 1:51:12 am Tim Kientzle wrote: >>=20 >> On Jan 26, 2013, at 3:56 PM, Tim Kientzle wrote: >>=20 >>> My next TODO items for this network driver is to implement >>> the SIOCADDMULTI and SIOCDELMULTI ioctls. >>=20 >> DELMULTI seems trickier. ... >> ... it looks like I have no choice but to remove >> every multicast address from the controller and then >> re-insert all of the ones that are still valid. >> ... >> Is there a better approach? >=20 > You should always reprogram the full table while holding = if_maddr_rlock(). Thanks. That's ultimately what I did. I was able to dump the table from the controller to eyeball that the entries looked right but haven't yet done any testing beyond that. >> Would still appreciate any suggestions for how to test these. >=20 > You can write a simple app to listen for UDP packets and have it join = a=20 > multicast group and have another machine on the same network write a = packet to=20 > the multicast group. I tried this first, but the test program worked fine even without ADDMULTI/DELMULTI support. Watching tcpdump -e, it appears that IP4 multicast UDP uses broadcast at the Ethernet layer. > However, a simpler test is to toggle the sysctl to enable multicast = ping=20 > replies and to ping a multicast address from another machine after = joining it=20 > on the test machine using mutest. Ahhh=85. I wasn't aware of these tools; I'll take a look. Thanks for the pointer! Tim