net: switchdev: ignore unsupported bridge flags
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Tue, 23 Jun 2015 14:26:04 +0000 (10:26 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jun 2015 08:06:34 +0000 (01:06 -0700)
switchdev_port_bridge_getlink() queries SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS
attributes, but a driver doesn't need to implement this in order to get
bridge link information.

So error out only on errors different than -EOPNOTSUPP.

(This is a follow-up patch for 7d4f8d8.)

Fixes: 8793d0a664a8 ("switchdev: add new switchdev_port_bridge_getlink")
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/switchdev/switchdev.c

index f01d34075749eb5e8faf96646e40135615942409..84f77a0540251cbe127785de670e5b0a41a3bdac 100644 (file)
@@ -532,7 +532,7 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
        int err;
 
        err = switchdev_port_attr_get(dev, &attr);
-       if (err)
+       if (err && err != -EOPNOTSUPP)
                return err;
 
        return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode,