From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felix Fietkau Subject: [PATCH] net: igmp: fix source address check for IGMPv3 reports Date: Fri, 19 Jan 2018 11:50:46 +0100 Message-ID: <20180119105046.44870-1-nbd@nbd.name> Cc: cernekee@chromium.org, s.gottschall@dd-wrt.com To: netdev@vger.kernel.org Return-path: Received: from nbd.name ([46.4.11.11]:43424 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbeASKuu (ORCPT ); Fri, 19 Jan 2018 05:50:50 -0500 Sender: netdev-owner@vger.kernel.org List-ID: Commit "net: igmp: Use correct source address on IGMPv3 reports" introduced a check to validate the source address of locally generated IGMPv3 packets. Instead of checking the local interface address directly, it uses inet_ifa_match(fl4->saddr, ifa), which checks if the address is on the local subnet (or equal to the point-to-point address if used). This breaks for point-to-point interfaces, so check against ifa->ifa_local directly. Cc: Kevin Cernekee Fixes: a46182b00290 ("net: igmp: Use correct source address on IGMPv3 reports") Reported-by: Sebastian Gottschall Signed-off-by: Felix Fietkau --- net/ipv4/igmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 726f6b608274..2d49717a7421 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -332,7 +332,7 @@ static __be32 igmpv3_get_srcaddr(struct net_device *dev, return htonl(INADDR_ANY); for_ifa(in_dev) { - if (inet_ifa_match(fl4->saddr, ifa)) + if (fl4->saddr == ifa->ifa_local) return fl4->saddr; } endfor_ifa(in_dev); -- 2.14.2