From owner-freebsd-net Thu Jun 6 15: 3:38 2002 Delivered-To: freebsd-net@freebsd.org Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by hub.freebsd.org (Postfix) with ESMTP id 4C78D37B406 for ; Thu, 6 Jun 2002 15:03:30 -0700 (PDT) Received: from blossom.cjclark.org ([12.234.91.48]) by sccrmhc02.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020606220329.FQBH975.sccrmhc02.attbi.com@blossom.cjclark.org>; Thu, 6 Jun 2002 22:03:29 +0000 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.6) id g56M3Si94140; Thu, 6 Jun 2002 15:03:28 -0700 (PDT) (envelope-from crist.clark@attbi.com) X-Authentication-Warning: blossom.cjclark.org: cjc set sender to crist.clark@attbi.com using -f Date: Thu, 6 Jun 2002 15:03:28 -0700 From: "Crist J. Clark" To: Vadim Egorov Cc: freebsd-net@FreeBSD.ORG Subject: Re: IP_MULTICAST_LOOP Message-ID: <20020606150328.G93321@blossom.cjclark.org> Reply-To: "Crist J. Clark" References: <86vg8wu5cw.fsf@my.egorovv.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <86vg8wu5cw.fsf@my.egorovv.net>; from egorovv@attbi.com on Thu, Jun 06, 2002 at 02:24:47AM -0700 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, Jun 06, 2002 at 02:24:47AM -0700, Vadim Egorov wrote: > > Hi guys! > > I'm playing with multicasting (-stable), and I want to disable looping back > my outgoing packets setting IP_MULTICAST_LOOP option to 0 but it doen't > have any effect. My app is listening to the same group it is casting. > > After some grepping I came across some code in netinet/ip_output.c: > (imo == NULL || imo->imo_multicast_loop)) { > /* > * If we belong to the destination multicast group > * on the outgoing interface, and the caller did not > * forbid loopback, loop back a copy. > */ > > The comment says 'and' but the code says '||' -- looks like an error to me. > Except this I've got no idea what it means - does it make amy sence? The line you quote is only checking the "caller did not forbid loopback" portion. It evaluates true when no options are set (imo == NULL) or when the IP_MULTICAST_LOOP (imo->imo_multicast_loop) is non-zero. The first conditional is just defaulting to loopback when no options are present. The "and" part of the conditional was on the previous line. Here's the whole conditional, if (inm != NULL && (imo == NULL || imo->imo_multicast_loop)) { -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message