summaryrefslogtreecommitdiff
path: root/net/bridge/br_mdb.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-03-02 00:55:08 +0300
committerDavid S. Miller <davem@davemloft.net>2016-03-02 00:55:08 +0300
commit4ec620700cda720ac7480ce92e8795d735ff1502 (patch)
treead2d8d083eb9dd2b5c9091f23f727ff0d70b0953 /net/bridge/br_mdb.c
parentec1606c0906de35dbc6f21aea75c2b950104cae5 (diff)
parent59f78f9f6c2e80dcf0f520be85b660f856217b79 (diff)
downloadlinux-4ec620700cda720ac7480ce92e8795d735ff1502.tar.xz
Merge branch 'bridge-mcast-tmp-router-port'
Nikolay Aleksandrov says: ==================== bridge: mcast: add support for temp router port This set adds support for temporary router port which doesn't depend only on the incoming queries. It can be refreshed by setting multicast_router to the same value (3). The first two patches are minor changes that prepare the code for the third which adds this new type of router port. In order to be able to dump its information the mdb router port format is changed in patch 04 and extended similar to how mdb entries format was done recently. The related iproute2 changes will be posted if this is accepted. v2: set val first and adjust router type later in patch 01, patch 03 was split in 2 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_mdb.c')
-rw-r--r--net/bridge/br_mdb.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index 73786e2fe065..253bc77eda3b 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -20,7 +20,7 @@ static int br_rports_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
{
struct net_bridge *br = netdev_priv(dev);
struct net_bridge_port *p;
- struct nlattr *nest;
+ struct nlattr *nest, *port_nest;
if (!br->multicast_router || hlist_empty(&br->router_list))
return 0;
@@ -30,8 +30,20 @@ static int br_rports_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
return -EMSGSIZE;
hlist_for_each_entry_rcu(p, &br->router_list, rlist) {
- if (p && nla_put_u32(skb, MDBA_ROUTER_PORT, p->dev->ifindex))
+ if (!p)
+ continue;
+ port_nest = nla_nest_start(skb, MDBA_ROUTER_PORT);
+ if (!port_nest)
goto fail;
+ if (nla_put_nohdr(skb, sizeof(u32), &p->dev->ifindex) ||
+ nla_put_u32(skb, MDBA_ROUTER_PATTR_TIMER,
+ br_timer_value(&p->multicast_router_timer)) ||
+ nla_put_u8(skb, MDBA_ROUTER_PATTR_TYPE,
+ p->multicast_router)) {
+ nla_nest_cancel(skb, port_nest);
+ goto fail;
+ }
+ nla_nest_end(skb, port_nest);
}
nla_nest_end(skb, nest);