diff options
author | Vlad Yasevich <vyasevic@redhat.com> | 2013-02-13 07:00:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-13 19:41:46 -0500 |
commit | 6cbdceeb1cb12c7d620161925a8c3e81daadb2e4 (patch) | |
tree | 81852fee23a380456cce4d2c1bb5ec52c7ff0013 /net/core/rtnetlink.c | |
parent | 407af3299ef1ac7e87ce3fb530e32a009d1a9efd (diff) |
bridge: Dump vlan information from a bridge port
Using the RTM_GETLINK dump the vlan filter list of a given
bridge port. The information depends on setting the filter
flag similar to how nic VF info is dumped.
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 2c9ccbfbd93c..f3a112ec86d5 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -2315,6 +2315,13 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb) | |||
2315 | int idx = 0; | 2315 | int idx = 0; |
2316 | u32 portid = NETLINK_CB(cb->skb).portid; | 2316 | u32 portid = NETLINK_CB(cb->skb).portid; |
2317 | u32 seq = cb->nlh->nlmsg_seq; | 2317 | u32 seq = cb->nlh->nlmsg_seq; |
2318 | struct nlattr *extfilt; | ||
2319 | u32 filter_mask = 0; | ||
2320 | |||
2321 | extfilt = nlmsg_find_attr(cb->nlh, sizeof(struct rtgenmsg), | ||
2322 | IFLA_EXT_MASK); | ||
2323 | if (extfilt) | ||
2324 | filter_mask = nla_get_u32(extfilt); | ||
2318 | 2325 | ||
2319 | rcu_read_lock(); | 2326 | rcu_read_lock(); |
2320 | for_each_netdev_rcu(net, dev) { | 2327 | for_each_netdev_rcu(net, dev) { |
@@ -2324,14 +2331,15 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb) | |||
2324 | if (br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { | 2331 | if (br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { |
2325 | if (idx >= cb->args[0] && | 2332 | if (idx >= cb->args[0] && |
2326 | br_dev->netdev_ops->ndo_bridge_getlink( | 2333 | br_dev->netdev_ops->ndo_bridge_getlink( |
2327 | skb, portid, seq, dev) < 0) | 2334 | skb, portid, seq, dev, filter_mask) < 0) |
2328 | break; | 2335 | break; |
2329 | idx++; | 2336 | idx++; |
2330 | } | 2337 | } |
2331 | 2338 | ||
2332 | if (ops->ndo_bridge_getlink) { | 2339 | if (ops->ndo_bridge_getlink) { |
2333 | if (idx >= cb->args[0] && | 2340 | if (idx >= cb->args[0] && |
2334 | ops->ndo_bridge_getlink(skb, portid, seq, dev) < 0) | 2341 | ops->ndo_bridge_getlink(skb, portid, seq, dev, |
2342 | filter_mask) < 0) | ||
2335 | break; | 2343 | break; |
2336 | idx++; | 2344 | idx++; |
2337 | } | 2345 | } |
@@ -2372,14 +2380,14 @@ static int rtnl_bridge_notify(struct net_device *dev, u16 flags) | |||
2372 | 2380 | ||
2373 | if ((!flags || (flags & BRIDGE_FLAGS_MASTER)) && | 2381 | if ((!flags || (flags & BRIDGE_FLAGS_MASTER)) && |
2374 | br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { | 2382 | br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { |
2375 | err = br_dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev); | 2383 | err = br_dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0); |
2376 | if (err < 0) | 2384 | if (err < 0) |
2377 | goto errout; | 2385 | goto errout; |
2378 | } | 2386 | } |
2379 | 2387 | ||
2380 | if ((flags & BRIDGE_FLAGS_SELF) && | 2388 | if ((flags & BRIDGE_FLAGS_SELF) && |
2381 | dev->netdev_ops->ndo_bridge_getlink) { | 2389 | dev->netdev_ops->ndo_bridge_getlink) { |
2382 | err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev); | 2390 | err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0); |
2383 | if (err < 0) | 2391 | if (err < 0) |
2384 | goto errout; | 2392 | goto errout; |
2385 | } | 2393 | } |