From patchwork Tue Mar 27 15:38:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Fastabend X-Patchwork-Id: 891678 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 409Zth6p2zz9s1P for ; Wed, 28 Mar 2018 02:39:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbeC0PjG (ORCPT ); Tue, 27 Mar 2018 11:39:06 -0400 Received: from [75.106.27.153] ([75.106.27.153]:57870 "EHLO john-Precision-Tower-5810" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752590AbeC0PjE (ORCPT ); Tue, 27 Mar 2018 11:39:04 -0400 Received: from [127.0.1.1] (localhost [127.0.0.1]) by john-Precision-Tower-5810 (Postfix) with ESMTP id 52E02D42AE4; Tue, 27 Mar 2018 08:38:59 -0700 (PDT) Subject: [bpf-next PATCH] net: br_vlan build error From: John Fastabend To: stephen@networkplumber.org, 3chas3@gmail.com Cc: netdev@vger.kernel.org, davem@davemloft.net Date: Tue, 27 Mar 2018 08:38:59 -0700 Message-ID: <20180327153859.28865.74511.stgit@john-Precision-Tower-5810> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix build error in br_if.c net/bridge/br_if.c: In function ‘br_mtu’: net/bridge/br_if.c:458:8: error: ‘const struct net_bridge’ has no member named ‘vlan_enabled’ if (br->vlan_enabled) ^ net/bridge/br_if.c:462:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ Fixes: 419d14af9e07f ("bridge: Allow max MTU when multiple VLANs present") Signed-off-by: John Fastabend --- net/bridge/br_if.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 48dc4d2..2262424 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -424,16 +424,6 @@ int br_del_bridge(struct net *net, const char *name) return ret; } -static bool min_mtu(int a, int b) -{ - return a < b ? 1 : 0; -} - -static bool max_mtu(int a, int b) -{ - return a > b ? 1 : 0; -} - /* MTU of the bridge pseudo-device: ETH_DATA_LEN or the minimum of the ports */ static int __br_mtu(const struct net_bridge *br, bool (compare_fn)(int, int)) { @@ -453,6 +443,17 @@ static int __br_mtu(const struct net_bridge *br, bool (compare_fn)(int, int)) return mtu; } +static bool min_mtu(int a, int b) +{ + return a < b ? 1 : 0; +} + +#ifdef CONFIG_BRIDGE_VLAN_FILTERING +static bool max_mtu(int a, int b) +{ + return a > b ? 1 : 0; +} + int br_mtu(const struct net_bridge *br) { if (br->vlan_enabled) @@ -460,6 +461,12 @@ int br_mtu(const struct net_bridge *br) else return __br_mtu(br, min_mtu); } +#else +int br_mtu(const struct net_bridge *br) +{ + return __br_mtu(br, min_mtu); +} +#endif static void br_set_gso_limits(struct net_bridge *br) {