* [PATCH] don't put multicasts with mc_ttl=0 on the wire
@ 2007-05-15 19:56 akepner
2007-05-15 20:45 ` David Miller
2007-05-15 21:40 ` David Stevens
0 siblings, 2 replies; 3+ messages in thread
From: akepner @ 2007-05-15 19:56 UTC (permalink / raw)
To: netdev; +Cc: arenaud
A colleague of mine found that multicasts with a ttl of 0
can be sent on the wire. This happens if the sender doesn't
belong to the destination multicast group.
With the following the multicast ttl is respected whether
or not the sender belongs to the destination multicast group.
Signed-off-by: Arthur Kepner <akepner@sgi.com>
---
net/ipv4/route.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index cb76e3c..bf25cf5 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2249,8 +2249,7 @@ static inline int __mkroute_output(struct rtable **result,
}
if (flags & (RTCF_BROADCAST | RTCF_MULTICAST)) {
rth->rt_spec_dst = fl->fl4_src;
- if (flags & RTCF_LOCAL &&
- !(dev_out->flags & IFF_LOOPBACK)) {
+ if (!(dev_out->flags & IFF_LOOPBACK)) {
rth->u.dst.output = ip_mc_output;
RT_CACHE_STAT_INC(out_slow_mc);
}
--
Arthur
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] don't put multicasts with mc_ttl=0 on the wire
2007-05-15 19:56 [PATCH] don't put multicasts with mc_ttl=0 on the wire akepner
@ 2007-05-15 20:45 ` David Miller
2007-05-15 21:40 ` David Stevens
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2007-05-15 20:45 UTC (permalink / raw)
To: akepner; +Cc: netdev, arenaud
From: akepner@sgi.com
Date: Tue, 15 May 2007 12:56:02 -0700
> A colleague of mine found that multicasts with a ttl of 0
> can be sent on the wire. This happens if the sender doesn't
> belong to the destination multicast group.
>
> With the following the multicast ttl is respected whether
> or not the sender belongs to the destination multicast group.
>
> Signed-off-by: Arthur Kepner <akepner@sgi.com>
This is actually used by some things if I remember correctly.
See this command and code in net/ipv4/route.c:
/* Special hack: user can direct multicasts
and limited broadcast via necessary interface
without fiddling with IP_MULTICAST_IF or IP_PKTINFO.
This hack is not just for fun, it allows
vic,vat and friends to work.
They bind socket to loopback, set ttl to zero
and expect that it will work.
From the viewpoint of routing cache they are broken,
because we are not allowed to build multicast path
with loopback source addr (look, routing cache
cannot know, that ttl is zero, so that packet
will not leave this host and route is valid).
Luckily, this hack is good workaround.
*/
fl.oif = dev_out->ifindex;
goto make_route;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] don't put multicasts with mc_ttl=0 on the wire
2007-05-15 19:56 [PATCH] don't put multicasts with mc_ttl=0 on the wire akepner
2007-05-15 20:45 ` David Miller
@ 2007-05-15 21:40 ` David Stevens
1 sibling, 0 replies; 3+ messages in thread
From: David Stevens @ 2007-05-15 21:40 UTC (permalink / raw)
To: akepner; +Cc: arenaud, netdev, netdev-owner
Arthur,
I assume you're making use of the hack mentioned in route.c:
"... This hack is not just for fun, it allows vic, vat and friends to
work.
They bind socket to loopback, set ttl to zero and expect that it will
work."
I don't know the details of the intent for this hack, but did you
test that it won't break them?
A multicast application that relies on the (unicast) routing table
at all is broken IMHO, as is an app that sets the TTL to 0, but shouldn't
all ttl 0 packets about to be sent to the wire be dropped? Wouldn't that
be a better way to handle this case?
+-DLS
netdev-owner@vger.kernel.org wrote on 05/15/2007 12:56:02 PM:
> A colleague of mine found that multicasts with a ttl of 0
> can be sent on the wire. This happens if the sender doesn't
> belong to the destination multicast group.
>
> With the following the multicast ttl is respected whether
> or not the sender belongs to the destination multicast group.
>
> Signed-off-by: Arthur Kepner <akepner@sgi.com>
>
> ---
>
> net/ipv4/route.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index cb76e3c..bf25cf5 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2249,8 +2249,7 @@ static inline int __mkroute_output(struct rtable
**result,
> }
> if (flags & (RTCF_BROADCAST | RTCF_MULTICAST)) {
> rth->rt_spec_dst = fl->fl4_src;
> - if (flags & RTCF_LOCAL &&
> - !(dev_out->flags & IFF_LOOPBACK)) {
> + if (!(dev_out->flags & IFF_LOOPBACK)) {
> rth->u.dst.output = ip_mc_output;
> RT_CACHE_STAT_INC(out_slow_mc);
> }
>
> --
> Arthur
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-15 21:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-15 19:56 [PATCH] don't put multicasts with mc_ttl=0 on the wire akepner
2007-05-15 20:45 ` David Miller
2007-05-15 21:40 ` David Stevens
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).