Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683AbdLMLeb (ORCPT ); Wed, 13 Dec 2017 06:34:31 -0500 Received: from ec2-13-54-119-68.ap-southeast-2.compute.amazonaws.com ([13.54.119.68]:38694 "EHLO mail.hermana.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbdLMLe1 (ORCPT ); Wed, 13 Dec 2017 06:34:27 -0500 From: Brendan McGrath To: "David S . Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Brendan McGrath Subject: [PATCH] ipv6: icmp6: Allow icmp messages to be looped back Date: Wed, 13 Dec 2017 22:14:57 +1100 Message-Id: <1513163697-21136-1-git-send-email-redmcg@redmandi.dyndns.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1360 Lines: 42 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 --- 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