diff mbox series

[SRU,J,1/1] UBUNTU: SAUCE: net: switchdev: fix compilation error for CONFIG_NET_SWITCHDEV=n

Message ID 20250327135648.3811415-2-koichiro.den@canonical.com
State New
Headers show
Series build failure when CONFIG_NET_SWITCHDEV=n (CVE-2024-26837 follow-up) | expand

Commit Message

Koichiro Den March 27, 2025, 1:56 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2104380

Since jammy:linux commit 0158242f01a0 ("net: bridge: switchdev: Skip MDB
replays of deferred events on offload"), the kernel build fails when
CONFIG_NET_SWITCHDEV=n, as observed in e.g. jammy:linux-kvm.

/build/jammy/net/bridge/br_mdb.c: In function 'br_mdb_queue_one':
/build/jammy/net/bridge/br_mdb.c:640:13: error: implicit declaration of function
'switchdev_port_obj_act_is_deferred'; did you mean 'switchdev_port_obj_add'? \
  [-Werror=implicit- function-declaration]

  640 |             switchdev_port_obj_act_is_deferred(dev, action, &mdb.obj)) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             switchdev_port_obj_add

Fix this by adding dummy switchdev_port_obj_act_is_deferred() for the
CONFIG_NET_SWITCHDEV=n case.

Fixes: 0158242f01a0 ("net: bridge: switchdev: Skip MDB replays of deferred events on offload") # jammy:linux
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
---
 include/net/switchdev.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 161bdd1d9645..16ea63b1c656 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -376,6 +376,13 @@  static inline int switchdev_port_attr_set(struct net_device *dev,
 	return -EOPNOTSUPP;
 }
 
+static bool switchdev_port_obj_act_is_deferred(struct net_device *dev,
+					       enum switchdev_notifier_type nt,
+					       const struct switchdev_obj *obj)
+{
+	return false;
+}
+
 static inline int switchdev_port_obj_add(struct net_device *dev,
 					 const struct switchdev_obj *obj,
 					 struct netlink_ext_ack *extack)