From patchwork Wed Oct 16 08:07:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshiaki Makita X-Patchwork-Id: 283873 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C01D12C0146 for ; Wed, 16 Oct 2013 19:08:15 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760159Ab3JPIIK (ORCPT ); Wed, 16 Oct 2013 04:08:10 -0400 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:50640 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759964Ab3JPIIG (ORCPT ); Wed, 16 Oct 2013 04:08:06 -0400 Received: from mfs6.rdh.ecl.ntt.co.jp (mfs6.rdh.ecl.ntt.co.jp [129.60.39.149]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id r9G87v8G000767; Wed, 16 Oct 2013 17:07:57 +0900 Received: from mfs6.rdh.ecl.ntt.co.jp (localhost.localdomain [127.0.0.1]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 36D11E013F; Wed, 16 Oct 2013 17:07:57 +0900 (JST) Received: from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 214FDE0135; Wed, 16 Oct 2013 17:07:57 +0900 (JST) Received: from ubuntu-vm-makita ([129.60.241.144]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id r9G87u7J015848; Wed, 16 Oct 2013 17:07:57 +0900 Received: by ubuntu-vm-makita (Postfix, from userid 1000) id 5B6231E0A5E; Wed, 16 Oct 2013 17:07:41 +0900 (JST) From: Toshiaki Makita To: "David S . Miller" , Vlad Yasevich , netdev@vger.kernel.org Cc: Toshiaki Makita , Toshiaki Makita Subject: [PATCH v2 net 4/4] bridge: Fix updating FDB entries when the PVID is applied Date: Wed, 16 Oct 2013 17:07:16 +0900 Message-Id: <1381910836-718-5-git-send-email-makita.toshiaki@lab.ntt.co.jp> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381910836-718-1-git-send-email-makita.toshiaki@lab.ntt.co.jp> References: <1381910836-718-1-git-send-email-makita.toshiaki@lab.ntt.co.jp> X-TM-AS-MML: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We currently set the value that variable vid is pointing, which will be used in FDB later, to 0 at br_allowed_ingress() when we receive untagged or priority-tagged frames, even though the PVID is valid. This leads to FDB updates in such a wrong way that they are learned with VID 0. Update the value to that of PVID if the PVID is applied. Signed-off-by: Toshiaki Makita Reviewed-by: Vlad Yasevich --- net/bridge/br_vlan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index 5a9c44a..53f0990 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -217,6 +217,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, /* PVID is set on this port. Any untagged or priority-tagged * ingress frame is considered to belong to this vlan. */ + *vid = pvid; if (likely(err)) /* Untagged Frame. */ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid);