Netdev List
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: stephen@networkplumber.org, 3chas3@gmail.com
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: [bpf-next PATCH] net: br_vlan build error
Date: Tue, 27 Mar 2018 08:38:59 -0700	[thread overview]
Message-ID: <20180327153859.28865.74511.stgit@john-Precision-Tower-5810> (raw)

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 <john.fastabend@gmail.com>
---
 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)
 {

             reply	other threads:[~2018-03-27 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 15:38 John Fastabend [this message]
2018-03-27 15:49 ` [bpf-next PATCH] net: br_vlan build error Nikolay Aleksandrov
2018-03-27 15:58   ` John Fastabend
2018-03-27 15:57 ` John Fastabend

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180327153859.28865.74511.stgit@john-Precision-Tower-5810 \
    --to=john.fastabend@gmail.com \
    --cc=3chas3@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox