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                     |     [EMAIL PROTECTED]
                                   |     [EMAIL PROTECTED]
http://people.freebsd.org/~cjc/    |     [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to