netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* TTL=0 multicast packets leaving host
@ 2011-12-07 21:31 Shawn Bohrer
  2011-12-19 21:06 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn Bohrer @ 2011-12-07 21:31 UTC (permalink / raw)
  To: netdev

We've got some machines where we've noticed that in some cases TTL=0
multicast traffic was leaving the host.  It appear that ip_mc_output()
does the correct check with:

                ...
                /* Multicasts with ttl 0 must not go beyond the host */

                if (ip_hdr(skb)->ttl == 0) {
                        kfree_skb(skb);
                        return 0;
                }
                ...

The problem is that in __mkroute_output() it checks if the local
computer is a member of the multicast group, and if not clears
RTCF_LOCAL

                ...
                if (!ip_check_mc_rcu(in_dev, fl4->daddr, fl4->saddr,
                                     fl4->flowi4_proto))
                        flags &= ~RTCF_LOCAL;
                ...

And if RTCF_LOCAL is _not_ set then ip_output() is used instead of
ip_mc_output()

        ...
        if (flags & (RTCF_BROADCAST | RTCF_MULTICAST)) {
                rth->rt_spec_dst = fl4->saddr;
                if (flags & RTCF_LOCAL &&
                    !(dev_out->flags & IFF_LOOPBACK)) {
                        rth->dst.output = ip_mc_output;
                        RT_CACHE_STAT_INC(out_slow_mc);
                }
        ...

This looks like a bug to me.  I'd assume that if the local computer
has not joined the multicast group and I send a TTL=0 packet that it
would simply get discarded.

--
Shawn



---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-19 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-07 21:31 TTL=0 multicast packets leaving host Shawn Bohrer
2011-12-19 21:06 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).