Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3702551pxk; Tue, 29 Sep 2020 04:14:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT/3HPMRKJi6oA4AAiMLaKMiA8GUZ49GTLycvEflvrlb5XeRKxAxXRxJi7Rcl1PbJgI1y5 X-Received: by 2002:a17:906:7e4c:: with SMTP id z12mr3248109ejr.123.1601378043962; Tue, 29 Sep 2020 04:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601378043; cv=none; d=google.com; s=arc-20160816; b=Zu1gwwnxQQ8Q0JKhUiLS+6HaoGo57FOBu39ocOi+7Vv+9hpXp334qGx5BdDbuagtoI LWSIthwoW8tEuGHn++UvgAxazD5jmnpJifnSKA/V+TlgbDtPknDCYPYn7Lv3f/4XdDEy uijokNxkrb4DjTAWS7270n8OUiAZLfz5NrCPU575khjF55gKaqByG6Rdq4wEile7VVEn 68enW40HvAu0t1n5evBjgC73FffEqrunPDSo3auOFXReGvx6NJ31awh6wa4i2staFniP S3eAGCA9mlsHvqGPAxX+LcWVk6ktJwQfIjwAGHigQlPW19QOkqWncOOzdUq2dDJCM1ZO ZYWw== 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=6rucVOGZhC3q/gIZsMz3aIeB9Irm8AeYqHYHrAgOv3w=; b=UAg6r1wbHzhFxgih1pvwm0O8S2KbnsRCCM254cPXG4v9Q5yxXOoPucL4USpypkuoUV LUqbbl4WDr/1dMb3K74Xqu0FsTlKg87jRqHNFEMDrSBYFr56pwlrxG9gcwZuByR9EU1y UhFEGskefNWUwVoShECytr5alKBQrzRN6j01NPGBf5Zq6gtXwc95NF06NnEwHqEUCZuK zXCUHlHeWK63zEAtAHXotyYkKbEy3YPZmSPtW7CC6DiLJEBVMxat/VMFjrm1cO9wZslF rcVA58K808xhzSpDuI7uzvFMPSEdjfrchnSHA2iFvukmCJxyD/s3Ao54qbS3Ltac0NV5 9kPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ta1djdTY; 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 t18si2353344eje.652.2020.09.29.04.13.40; Tue, 29 Sep 2020 04:14:03 -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=Ta1djdTY; 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 S1728634AbgI2LLj (ORCPT + 99 others); Tue, 29 Sep 2020 07:11:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729258AbgI2LLh (ORCPT ); Tue, 29 Sep 2020 07:11:37 -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 580EE20848; Tue, 29 Sep 2020 11:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377896; bh=D6Gt21NdP1RHVX6qAJIxw+Gh3//0YjI+ZRly1D7O83k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ta1djdTYksgjq2S9LP/05k5sl0R9CJD11mMXX4XC93jhbn/Sw9dvD4C9f9SNw+CB7 RUodtVbvYoVs/tGTsNzXtK2MHIGg/ddLhfKjSKxWvEt2eZ9PQ8rKecyNsDqmAI/KPH oOyQMNMppd6sx9vUfaCgfDSNpzYUMjNWL6sLvBxM= 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.9 111/121] batman-adv: mcast/TT: fix wrongly dropped or rerouted packets Date: Tue, 29 Sep 2020 13:00:55 +0200 Message-Id: <20200929105935.682499040@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105930.172747117@linuxfoundation.org> References: <20200929105930.172747117@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 19059ae26e519..1ba205c3ea9fa 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -803,6 +803,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