From patchwork Tue Apr 28 18:24:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3E32C83000 for ; Tue, 28 Apr 2020 18:28:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D4933214D8 for ; Tue, 28 Apr 2020 18:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588098521; bh=VCUEQTgmfZLGjvgi/6tnlrZ8RE72jb9+fRQ4fCctbC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=muMK50h32667enxO5pHPlf1qJmcyh0GUG2DOgFYapHpfAPh7BbNpO8u/Iz0LI65vP A3AEcEtpL0e2sKZDmLKGoqugPjMAhkndfV5Ym0LvTs7uSzJZQiyZ4zpGfsaxwGnah6 vypU5ix8bbYjPsge0689nEeV9HcnMj3e/gYVqZMQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729228AbgD1S2k (ORCPT ); Tue, 28 Apr 2020 14:28:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:41716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729226AbgD1S2j (ORCPT ); Tue, 28 Apr 2020 14:28:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 C19AB214AF; Tue, 28 Apr 2020 18:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588098519; bh=VCUEQTgmfZLGjvgi/6tnlrZ8RE72jb9+fRQ4fCctbC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=euqOyhEQz+VJFGga9yvpbRX4q7894IuUoI/qOmuMiE6AJc1kRIreYGYHuAAKRo6pL OU7yd+DvvdgdpVpZgkQpXDV6K6Ryf9kGBNm6RzowjlfDUEFf2/4dh9HhNkS1nTaWFw ewLShZE2rhkMBdwu0zEEUgr2dllsfTCLkH0HiWpY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Lunn , Florian Fainelli , "David S. Miller" Subject: [PATCH 5.6 065/167] net: dsa: b53: Lookup VID in ARL searches when VLAN is enabled Date: Tue, 28 Apr 2020 20:24:01 +0200 Message-Id: <20200428182233.201072476@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428182225.451225420@linuxfoundation.org> References: <20200428182225.451225420@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli [ Upstream commit 2e97b0cd1651a270f3a3fcf42115c51f3284c049 ] When VLAN is enabled, and an ARL search is issued, we also need to compare the full {MAC,VID} tuple before returning a successful search result. Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations") Reviewed-by: Andrew Lunn Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/b53/b53_common.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1485,6 +1485,9 @@ static int b53_arl_read(struct b53_devic continue; if ((mac_vid & ARLTBL_MAC_MASK) != mac) continue; + if (dev->vlan_enabled && + ((mac_vid >> ARLTBL_VID_S) & ARLTBL_VID_MASK) != vid) + continue; *idx = i; }