diff options
author | Richard Alpe <richard.alpe@ericsson.com> | 2015-05-06 13:58:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-09 16:40:02 -0400 |
commit | 670f4f8818ee54d0c1831e3165dadd5b8a3f713e (patch) | |
tree | 61d37ad05026b8302cc2a286a4d9ce93ab641f82 /net/tipc/bcast.c | |
parent | c3d6fb85b2ed6a57b57b322a470b3b4eefb34fb7 (diff) |
tipc: add broadcast link window set/get to nl api
Add the ability to get or set the broadcast link window through the
new netlink API. The functionality was unintentionally missing from
the new netlink API. Adding this means that we also fix the breakage
in the old API when coming through the compat layer.
Fixes: 37e2d4843f9e (tipc: convert legacy nl link prop set to nl compat)
Reported-by: Tomi Ollila <tomi.ollila@iki.fi>
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r-- | net/tipc/bcast.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index c5cbdcb1f0b5..3e18fc6c7877 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -866,6 +866,27 @@ int tipc_bclink_set_queue_limits(struct net *net, u32 limit) return 0; } +int tipc_nl_bc_link_set(struct net *net, struct nlattr *attrs[]) +{ + int err; + u32 win; + struct nlattr *props[TIPC_NLA_PROP_MAX + 1]; + + if (!attrs[TIPC_NLA_LINK_PROP]) + return -EINVAL; + + err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_LINK_PROP], props); + if (err) + return err; + + if (!props[TIPC_NLA_PROP_WIN]) + return -EOPNOTSUPP; + + win = nla_get_u32(props[TIPC_NLA_PROP_WIN]); + + return tipc_bclink_set_queue_limits(net, win); +} + int tipc_bclink_init(struct net *net) { struct tipc_net *tn = net_generic(net, tipc_net_id); |