diff options
author | Richard Alpe <richard.alpe@ericsson.com> | 2015-02-09 09:50:09 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-09 13:20:48 -0800 |
commit | 1817877b3cd7b4dc73e4a1514d5f48eaa3989ec9 (patch) | |
tree | 7aa83bc3d462fc0ba6e14c211435f8fbcce9075c /net/tipc/netlink_compat.c | |
parent | 37e2d4843f9e2f5aad6bf3be5dad174f2838f375 (diff) | |
download | blackbird-op-linux-1817877b3cd7b4dc73e4a1514d5f48eaa3989ec9.tar.gz blackbird-op-linux-1817877b3cd7b4dc73e4a1514d5f48eaa3989ec9.zip |
tipc: convert legacy nl link stat reset to nl compat
Convert TIPC_CMD_RESET_LINK_STATS to compat doit.
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>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/netlink_compat.c')
-rw-r--r-- | net/tipc/netlink_compat.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 056532b41e7e..02461233b6d8 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -606,6 +606,26 @@ static int tipc_nl_compat_link_set(struct sk_buff *skb, return 0; } +static int tipc_nl_compat_link_reset_stats(struct sk_buff *skb, + struct tipc_nl_compat_msg *msg) +{ + char *name; + struct nlattr *link; + + name = (char *)TLV_DATA(msg->req); + + link = nla_nest_start(skb, TIPC_NLA_LINK); + if (!link) + return -EMSGSIZE; + + if (nla_put_string(skb, TIPC_NLA_LINK_NAME, name)) + return -EMSGSIZE; + + nla_nest_end(skb, link); + + return 0; +} + static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) { struct tipc_nl_compat_cmd_dump dump; @@ -650,6 +670,11 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) doit.doit = tipc_nl_link_set; doit.transcode = tipc_nl_compat_link_set; return tipc_nl_compat_doit(&doit, msg); + case TIPC_CMD_RESET_LINK_STATS: + msg->req_type = TIPC_TLV_LINK_NAME; + doit.doit = tipc_nl_link_reset_stats; + doit.transcode = tipc_nl_compat_link_reset_stats; + return tipc_nl_compat_doit(&doit, msg); } return -EOPNOTSUPP; @@ -754,6 +779,7 @@ static int tipc_nl_compat_tmp_wrap(struct sk_buff *skb, struct genl_info *info) case TIPC_CMD_SET_LINK_TOL: case TIPC_CMD_SET_LINK_PRI: case TIPC_CMD_SET_LINK_WINDOW: + case TIPC_CMD_RESET_LINK_STATS: return tipc_nl_compat_recv(skb, info); } |