From patchwork Fri Jan 19 10:50:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 863472 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nbd.name header.i=@nbd.name header.b="aVSRAXnn"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zNHg2723pz9ryv for ; Fri, 19 Jan 2018 21:50:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754910AbeASKux (ORCPT ); Fri, 19 Jan 2018 05:50:53 -0500 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CpPBycgcYQV46ngOsqIb5xjoKNZHvsbplvXkYx3ZiLc=; b=aVSRAXnn4YHzGVelnWyQ78ntni CSna7onyegIvqoDL8unfddmmuRUjWJFJX1GMCd58cqP+g4HZ5hMb/2/WUWfglApLbUlV+eF6XYv6O WSVBXWVZhOv65USh4Pvm2wXG538qwRQMtAPTcLhBLQCKzvTRTF4b/8IJ6IUQU/smP8VA=; Received: by maeck.lan (Postfix, from userid 501) id C1EBBE19F62; Fri, 19 Jan 2018 11:50:46 +0100 (CET) From: Felix Fietkau To: netdev@vger.kernel.org Cc: cernekee@chromium.org, s.gottschall@dd-wrt.com 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> X-Mailer: git-send-email 2.14.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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);