From patchwork Thu Jun 5 10:57:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshiaki Makita X-Patchwork-Id: 356303 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 1B8B7140080 for ; Thu, 5 Jun 2014 20:57:57 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751380AbaFEK5x (ORCPT ); Thu, 5 Jun 2014 06:57:53 -0400 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:44219 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751314AbaFEK5w (ORCPT ); Thu, 5 Jun 2014 06:57:52 -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 s55AvjOX006708; Thu, 5 Jun 2014 19:57:45 +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 80683E0142; Thu, 5 Jun 2014 19:57:45 +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 6B088E013F; Thu, 5 Jun 2014 19:57:45 +0900 (JST) Received: from ubuntu-vm-makita ([129.60.241.132]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id s55Avj5g020570; Thu, 5 Jun 2014 19:57:45 +0900 Received: by ubuntu-vm-makita (Postfix, from userid 1000) id 4DB771E0784; Thu, 5 Jun 2014 19:57:39 +0900 (JST) From: Toshiaki Makita To: "David S . Miller" , Stephen Hemminger Cc: Toshiaki Makita , Vlad Yasevich , netdev@vger.kernel.org, bridge@lists.linux-foundation.org Subject: [PATCH net-next] bridge: Fix incorrect judgment of promisc Date: Thu, 5 Jun 2014 19:57:31 +0900 Message-Id: <1401965851-6449-1-git-send-email-makita.toshiaki@lab.ntt.co.jp> X-Mailer: git-send-email 1.8.1.2 X-TM-AS-MML: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org br_manage_promisc() incorrectly expects br_auto_port() to return only 0 or 1, while it actually returns flags, i.e., a subset of BR_AUTO_MASK. Signed-off-by: Toshiaki Makita --- net/bridge/br_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index a08d2b8..6a07a40 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -153,7 +153,7 @@ void br_manage_promisc(struct net_bridge *br) * This lets us disable promiscuous mode and write * this config to hw. */ - if (br->auto_cnt <= br_auto_port(p)) + if (br->auto_cnt <= !!br_auto_port(p)) br_port_clear_promisc(p); else br_port_set_promisc(p);