linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: icmp6: Allow icmp messages to be looped back
@ 2017-12-13 11:14 Brendan McGrath
  2017-12-17  3:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Brendan McGrath @ 2017-12-13 11:14 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI, netdev,
	linux-kernel
  Cc: Brendan McGrath

One example of when an ICMPv6 packet is required to be looped back is
when a host acts as both a Multicast Listener and a Multicast Router.

A Multicast Router will listen on address ff02::16 for MLDv2 messages.

Currently, MLDv2 messages originating from a Multicast Listener running
on the same host as the Multicast Router are not being delivered to the
Multicast Router. This is due to dst.input being assigned the default
value of dst_discard.

This results in the packet being looped back but discarded before being
delivered to the Multicast Router.

This patch sets dst.input to ip6_input to ensure a looped back packet
is delivered to the Multicast Router.

Signed-off-by: Brendan McGrath <redmcg@redmandi.dyndns.org>
---

I considered putting this in mld_sendpack after the call to icmp6_dst_alloc
but it looks like igmp6_send could use this fix too.

In the end I followed the example set by addrconf_dst_alloc


 net/ipv6/route.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b3f4d19..5c014ce 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2336,6 +2336,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
 	}
 
 	rt->dst.flags |= DST_HOST;
+	rt->dst.input = ip6_input;
 	rt->dst.output  = ip6_output;
 	rt->rt6i_gateway  = fl6->daddr;
 	rt->rt6i_dst.addr = fl6->daddr;
-- 
2.7.4

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

* Re: [PATCH] ipv6: icmp6: Allow icmp messages to be looped back
  2017-12-13 11:14 [PATCH] ipv6: icmp6: Allow icmp messages to be looped back Brendan McGrath
@ 2017-12-17  3:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-12-17  3:52 UTC (permalink / raw)
  To: redmcg; +Cc: kuznet, yoshfuji, netdev, linux-kernel

From: Brendan McGrath <redmcg@redmandi.dyndns.org>
Date: Wed, 13 Dec 2017 22:14:57 +1100

> One example of when an ICMPv6 packet is required to be looped back is
> when a host acts as both a Multicast Listener and a Multicast Router.
> 
> A Multicast Router will listen on address ff02::16 for MLDv2 messages.
> 
> Currently, MLDv2 messages originating from a Multicast Listener running
> on the same host as the Multicast Router are not being delivered to the
> Multicast Router. This is due to dst.input being assigned the default
> value of dst_discard.
> 
> This results in the packet being looped back but discarded before being
> delivered to the Multicast Router.
> 
> This patch sets dst.input to ip6_input to ensure a looped back packet
> is delivered to the Multicast Router.
> 
> Signed-off-by: Brendan McGrath <redmcg@redmandi.dyndns.org>

Ok, after a lot of consideration this seems like a reasonable way to
solve this problem.

Applied, thank you.

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

end of thread, other threads:[~2017-12-17  3:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13 11:14 [PATCH] ipv6: icmp6: Allow icmp messages to be looped back Brendan McGrath
2017-12-17  3:52 ` 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).