diff options
author | Jamal Hadi Salim <jhs@mojatatu.com> | 2014-07-10 07:01:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-10 15:37:33 -0400 |
commit | 5d5eacb34c9e1fdc0a47b885d832eaa4de860dc7 (patch) | |
tree | 880d3849c474c2d307928b99d22f9a4354e1387a /net/bridge | |
parent | 69b4b7a4148e94a3fe7f06f72ee70113a6c61837 (diff) |
bridge: fdb dumping takes a filter device
Dumping a bridge fdb dumps every fdb entry
held. With this change we are going to filter
on selected bridge port.
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_fdb.c | 5 | ||||
-rw-r--r-- | net/bridge/br_private.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 7be33667a839..6edecd11ecf0 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -676,6 +676,7 @@ errout: | |||
676 | int br_fdb_dump(struct sk_buff *skb, | 676 | int br_fdb_dump(struct sk_buff *skb, |
677 | struct netlink_callback *cb, | 677 | struct netlink_callback *cb, |
678 | struct net_device *dev, | 678 | struct net_device *dev, |
679 | struct net_device *filter_dev, | ||
679 | int idx) | 680 | int idx) |
680 | { | 681 | { |
681 | struct net_bridge *br = netdev_priv(dev); | 682 | struct net_bridge *br = netdev_priv(dev); |
@@ -691,6 +692,10 @@ int br_fdb_dump(struct sk_buff *skb, | |||
691 | if (idx < cb->args[0]) | 692 | if (idx < cb->args[0]) |
692 | goto skip; | 693 | goto skip; |
693 | 694 | ||
695 | if (filter_dev && (!f->dst || !f->dst->dev || | ||
696 | f->dst->dev != filter_dev)) | ||
697 | goto skip; | ||
698 | |||
694 | if (fdb_fill_info(skb, br, f, | 699 | if (fdb_fill_info(skb, br, f, |
695 | NETLINK_CB(cb->skb).portid, | 700 | NETLINK_CB(cb->skb).portid, |
696 | cb->nlh->nlmsg_seq, | 701 | cb->nlh->nlmsg_seq, |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 23caf5b0309e..62a7fa2e3569 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -399,7 +399,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], | |||
399 | int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev, | 399 | int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev, |
400 | const unsigned char *addr, u16 nlh_flags); | 400 | const unsigned char *addr, u16 nlh_flags); |
401 | int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, | 401 | int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, |
402 | struct net_device *dev, int idx); | 402 | struct net_device *dev, struct net_device *fdev, int idx); |
403 | int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p); | 403 | int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p); |
404 | void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p); | 404 | void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p); |
405 | 405 | ||