net: switchdev: fix return code of fdb_dump stub
authorDragos Tatulea <dragos@endocode.com>
Mon, 16 Nov 2015 09:52:48 +0000 (10:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Nov 2015 20:24:37 +0000 (15:24 -0500)
rtnl_fdb_dump always expects an index to be returned by the ndo_fdb_dump op,
but when CONFIG_NET_SWITCHDEV is off, it returns an error.

Fix that by returning the given unmodified idx.

A similar fix was 0890cf6cb6ab ("switchdev: fix return value of
switchdev_port_fdb_dump in case of error") but for the CONFIG_NET_SWITCHDEV=y
case.

Fixes: 45d4122ca7cd ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Dragos Tatulea <dragos@endocode.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/switchdev.h

index bc865e244efea0c4757a182274ad7ca9f9cc3266..1d22ce9f352e2e7610095c4b1774164aa6af4516 100644 (file)
@@ -323,7 +323,7 @@ static inline int switchdev_port_fdb_dump(struct sk_buff *skb,
                                          struct net_device *filter_dev,
                                          int idx)
 {
-       return -EOPNOTSUPP;
+       return idx;
 }
 
 static inline void switchdev_port_fwd_mark_set(struct net_device *dev,