Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3754082pxk; Tue, 29 Sep 2020 05:34:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOGyCdvIBX+55WDcJw7WVgB+qf6rC4p4AQHDNaKKesKjamLaTheyk1lgek94sAYcfLgiHN X-Received: by 2002:a17:906:c55:: with SMTP id t21mr3807883ejf.276.1601382860284; Tue, 29 Sep 2020 05:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601382860; cv=none; d=google.com; s=arc-20160816; b=hDUkKQFY7t9GhksjTpkw9+sN51FBI0cLamekP7elfcVJ1p9BqHplcWgH5Guk7j5u2r 8j1+++/TAZ4eojBUZqbKjop9BASysmYMho/45IEh7sC9CkwsMyM7bi5s3WpyTwNZamUq 2rVzFyaXc3/cjm2JC5Ui60mBHBHJ07FoH7QmY0yYZ0Id6exKs9nFJwE2YRd4OO2d5Yek HFp3rckvZZSJdbbCzRTZ9iU1DupKQz5iPcq+V8FfJZJTPdAE123RLGwZIQ+aaRS4SYTy e2ZZyb7DJselTE1n2Ogr3g4ZVhNpEspwtSiUejTGm+kebeYXYY/cg24EMi3BhI6q3MMn C5rw== 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=TUmu4wJKC14+/NGtjoESMiVKs89e+YJMcPzifO2wXss=; b=XWJZqUW1BJFi+8M5WSjslUNKDTcbl9lxevGAmn1/3yradVfgX20fCSMGuXu6mcr4bU 7t2fjtCxse4srpBBln+NnHv5MPgproGG7wlbVkHiOVu2hYGEIpuWDMEBzKlKLgOVQsLA OzeJLgRCKKlJd1K0/pAfcpVSNCBSlK/J4uQy3aJdOM/MaK8yPhkTNBkJtSbqCi60Podd C0UQZ5IF1gG9idu7fs2lMB4SGOq4Y2EYRh3gPmrXj+CgenwcrY5NzE+s1zriybf0LAgT vK2wndytJvAIF/qxw3Z7xWENp1XMLR+Gfh5AdJRNH6MKWNmqDdo3OlnHrLBjoisTFQTb 4mYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QfnUDUM2; 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 df7si2879521edb.271.2020.09.29.05.33.57; Tue, 29 Sep 2020 05:34:20 -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=QfnUDUM2; 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 S1732882AbgI2MdD (ORCPT + 99 others); Tue, 29 Sep 2020 08:33:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729398AbgI2LW5 (ORCPT ); Tue, 29 Sep 2020 07:22:57 -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 55C1023A69; Tue, 29 Sep 2020 11:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378399; bh=qfiBN5te5Aj3uWVWIYb5hvLAfLu9/lYWOqv/Rw331bY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QfnUDUM2porhT4DSiLYynqkTrGbrOmpvFP91OOSqKTo6/WW//d6lKrYwsSQzdxwSt 6yIYKEGPBmQR408ZAHqaDub+MsxPn4TB66ZNflSuDlQXy24aBUAkWZ7yE4MS/ClFun hc8SD1VecPOYNX9HRuKq2I+dC+rWd/OE6Xira4xY= 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.14 152/166] batman-adv: mcast/TT: fix wrongly dropped or rerouted packets Date: Tue, 29 Sep 2020 13:01:04 +0200 Message-Id: <20200929105942.780177802@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105935.184737111@linuxfoundation.org> References: <20200929105935.184737111@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 f59aac06733e1..83f73f840ff91 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -822,6 +822,10 @@ static bool 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