Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3700214pxk; Tue, 29 Sep 2020 04:10:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ2Q6rCyUnlxbv9qp3YDJE+6xJlRLFpQdHMnaXnWuZXM6EyjXvUxbcrcSqAbWuVNO7HLbY X-Received: by 2002:aa7:d458:: with SMTP id q24mr2648474edr.23.1601377836116; Tue, 29 Sep 2020 04:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601377836; cv=none; d=google.com; s=arc-20160816; b=TwM8fUnpFjJROZxvixi6pGw71IljkWj+LUDsD1mol0Ux/rBIwhAzGX4osTzMCwN3Ml ysP9ImT8HXTUg1dD9KPukHQjbgmzrojtjQIscUIqW+5onHjiTLpRSm5/SFw4KVTja5hU kD8aYpBWFu4ky4ymp8HkO2BR8Ip7X9SZuJCnTC/nwHwK+mzB/SY4P3X3c+Ig62tRF1sM yUTcx/6Utc30Ut4doN1Td4EYq4Z11eMHtQ9bq1+ZGvDyz9URhae3ILFzBEQTbxEE3WVF +lF3NjU0Ek9BtuQ7YrT//f++UaXVHplBzonbZmdB/WyY/LtdM6iDPkKUqePgid/SRL0P ZK2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UKuj6dT34eUfz5sXWsQzQ8pvntpuIGHDjP4l1vDxzfI=; b=Vtoty3uV8CTdON8ejyqLO4xGkCtjYz6DICOTgcEj4wnUOUlFbMFeGeBVdKG8J2B0zz ZB+JuZ7rvoaKNjIPRk4wvyory0cOXI+rAc4LllXgd6Kg4igphpGZd8wisin1B5JElY1A yvqBoKXkLxYs9gXpAip8LnCbJt7y4mZ2xza4xmRsGNSPi1sS1JqEWI26XNLH5R+ymlpX TOMFbc5xej31Wlc2HLDzfZI2mbRWqcyLxrAHVnDrFymH7CflDpXoKTmyvH0qg/gjs9eU 1VYKKkaVCpETqPnk6L002wGC0MR4LmU8OvQsk3Tjc9sh9R3kIeGCpd8FiOQABM0ePgJ1 d65A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xqFx9FuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si2450740ejm.28.2020.09.29.04.10.12; Tue, 29 Sep 2020 04:10:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xqFx9FuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728814AbgI2LGJ (ORCPT + 99 others); Tue, 29 Sep 2020 07:06:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:42496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728376AbgI2LGA (ORCPT ); Tue, 29 Sep 2020 07:06:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 231CE21D43; Tue, 29 Sep 2020 11:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377559; bh=qvdzGrCdpR/msg3CcRf0BZHpDkIJbQyWbMMnvIg9k3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xqFx9FuG+kt2YEbuRfoQto/7+5sw70cm4Fso43TNrdbdnsDm8psr3omMj1OqcMIV+ QMLHZQ2hlVzrHkHWIumF0sBcfccG0CBEYx3qKdRytj4WGNpoiJR/lBNoGl0VMu+B5j t7KvWAakH5EzxDkhWKloXgV+Rtc49B5PimiT6MWc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Linus=20L=C3=BCssing?= , Sven Eckelmann , Simon Wunderlich , Sasha Levin Subject: [PATCH 4.4 77/85] batman-adv: mcast/TT: fix wrongly dropped or rerouted packets Date: Tue, 29 Sep 2020 13:00:44 +0200 Message-Id: <20200929105932.043179957@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Lüssing [ Upstream commit 7dda5b3384121181c4e79f6eaeac2b94c0622c8d ] The unicast packet rerouting code makes several assumptions. For instance it assumes that there is always exactly one destination in the TT. This breaks for multicast frames in a unicast packets in several ways: For one thing if there is actually no TT entry and the destination node was selected due to the multicast tvlv flags it announced. Then an intermediate node will wrongly drop the packet. For another thing if there is a TT entry but the TTVN of this entry is newer than the originally addressed destination node: Then the intermediate node will wrongly redirect the packet, leading to duplicated multicast packets at a multicast listener and missing packets at other multicast listeners or multicast routers. Fixing this by not applying the unicast packet rerouting to batman-adv unicast packets with a multicast payload. We are not able to detect a roaming multicast listener at the moment and will just continue to send the multicast frame to both the new and old destination for a while in case of such a roaming multicast listener. Fixes: a73105b8d4c7 ("batman-adv: improved client announcement mechanism") Signed-off-by: Linus Lüssing Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Sasha Levin --- net/batman-adv/routing.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index b3e8b0e3073c2..e470410abb44d 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -782,6 +782,10 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, vid = batadv_get_vid(skb, hdr_len); ethhdr = (struct ethhdr *)(skb->data + hdr_len); + /* do not reroute multicast frames in a unicast header */ + if (is_multicast_ether_addr(ethhdr->h_dest)) + return true; + /* check if the destination client was served by this node and it is now * roaming. In this case, it means that the node has got a ROAM_ADV * message and that it knows the new destination in the mesh to re-route -- 2.25.1