diff options
author | MINOURA Makoto / 箕浦 真 <minoura@valinux.co.jp> | 2016-02-25 00:20:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-26 15:04:02 -0500 |
commit | 472681d57a5dde7c6d16b05469be57f1c4ed9d99 (patch) | |
tree | 2163ac3883c3c89c2a77abc356139edac189d966 /net/switchdev/switchdev.c | |
parent | 4c0b6eaf373a5323f03a3a20c42fc435715b073d (diff) |
net: ndo_fdb_dump should report -EMSGSIZE to rtnl_fdb_dump.
When the send skbuff reaches the end, nlmsg_put and friends returns
-EMSGSIZE but it is silently thrown away in ndo_fdb_dump. It is called
within a for_each_netdev loop and the first fdb entry of a following
netdev could fit in the remaining skbuff. This breaks the mechanism
of cb->args[0] and idx to keep track of the entries that are already
dumped, which results missing entries in bridge fdb show command.
Signed-off-by: Minoura Makoto <minoura@valinux.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r-- | net/switchdev/switchdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 47f7da58a7f0..8b5833c1ff2e 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -1093,8 +1093,11 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, | |||
1093 | .cb = cb, | 1093 | .cb = cb, |
1094 | .idx = idx, | 1094 | .idx = idx, |
1095 | }; | 1095 | }; |
1096 | int err; | ||
1096 | 1097 | ||
1097 | switchdev_port_obj_dump(dev, &dump.fdb.obj, switchdev_port_fdb_dump_cb); | 1098 | err = switchdev_port_obj_dump(dev, &dump.fdb.obj, |
1099 | switchdev_port_fdb_dump_cb); | ||
1100 | cb->args[1] = err; | ||
1098 | return dump.idx; | 1101 | return dump.idx; |
1099 | } | 1102 | } |
1100 | EXPORT_SYMBOL_GPL(switchdev_port_fdb_dump); | 1103 | EXPORT_SYMBOL_GPL(switchdev_port_fdb_dump); |