]> git.proxmox.com Git - pve-kernel-jessie.git/blob - fix-rtnl_bridge_getlink.patch
fix typo
[pve-kernel-jessie.git] / fix-rtnl_bridge_getlink.patch
1 From f8b65172fe4f8e6aab8946ba004a7176c0249e1d Mon Sep 17 00:00:00 2001
2 From: Alexandre Derumier <aderumier@odiso.com>
3 Date: Wed, 16 Sep 2015 08:43:56 +0200
4 Subject: [PATCH] fix rtnl_bridge_getlink
5
6 Looks like this was due to 85fdb956726ff2a ("switchdev: cut over to new
7 switchdev_port_bridge_getlink").
8 When CONFIG_SWITCHDEV is off, nodes that use switchdev api for
9 ndo_bridge_getlink (example, bonds, teams, rocker) can return
10 -EOPNOTSUPP. The problem went away on my box with the following patch. I
11 will submit an official patch in a bit.
12
13 Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
14 ---
15 net/core/rtnetlink.c | 27 +++++++++++++++++----------
16 1 file changed, 17 insertions(+), 10 deletions(-)
17
18 diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
19 index dc004b1..9e8cffc 100644
20 --- a/net/core/rtnetlink.c
21 +++ b/net/core/rtnetlink.c
22 @@ -3021,6 +3021,7 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb)
23 u32 portid = NETLINK_CB(cb->skb).portid;
24 u32 seq = cb->nlh->nlmsg_seq;
25 u32 filter_mask = 0;
26 + int err;
27
28 if (nlmsg_len(cb->nlh) > sizeof(struct ifinfomsg)) {
29 struct nlattr *extfilt;
30 @@ -3041,20 +3042,26 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb)
31 struct net_device *br_dev = netdev_master_upper_dev_get(dev);
32
33 if (br_dev && br_dev->netdev_ops->ndo_bridge_getlink) {
34 - if (idx >= cb->args[0] &&
35 - br_dev->netdev_ops->ndo_bridge_getlink(
36 - skb, portid, seq, dev, filter_mask,
37 - NLM_F_MULTI) < 0)
38 - break;
39 + if (idx >= cb->args[0]) {
40 + err = br_dev->netdev_ops->ndo_bridge_getlink(
41 + skb, portid, seq, dev,
42 + filter_mask, NLM_F_MULTI);
43 + if ( err < 0 && err != -EOPNOTSUPP)
44 + break;
45 + }
46 +
47 idx++;
48 }
49
50 if (ops->ndo_bridge_getlink) {
51 - if (idx >= cb->args[0] &&
52 - ops->ndo_bridge_getlink(skb, portid, seq, dev,
53 - filter_mask,
54 - NLM_F_MULTI) < 0)
55 - break;
56 + if (idx >= cb->args[0]) {
57 + err = ops->ndo_bridge_getlink(skb, portid,
58 + seq, dev,
59 + filter_mask,
60 + NLM_F_MULTI);
61 + if ( err < 0 && err != -EOPNOTSUPP)
62 + break;
63 + }
64 idx++;
65 }
66 }
67 --
68 2.1.4
69