diff options
author | Richard Alpe <richard.alpe@ericsson.com> | 2015-02-09 09:50:15 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-09 22:20:49 +0100 |
commit | 964f9501c1910c0835eee3cf870ba5aa44db1241 (patch) | |
tree | 637f191be17fdd1852ca8b439c03904bb479081c /net/tipc/netlink_compat.c | |
parent | tipc: convert legacy nl node addr set to nl compat (diff) | |
download | linux-964f9501c1910c0835eee3cf870ba5aa44db1241.tar.xz linux-964f9501c1910c0835eee3cf870ba5aa44db1241.zip |
tipc: convert legacy nl net id set to nl compat
Convert TIPC_CMD_SET_NETID 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 | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index aa0e3256ae93..c355476a6e7c 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -38,6 +38,7 @@ #include "name_table.h" #include "socket.h" #include "node.h" +#include "net.h" #include <net/genetlink.h> #include <linux/tipc_config.h> @@ -863,9 +864,13 @@ static int tipc_nl_compat_net_set(struct sk_buff *skb, if (!net) return -EMSGSIZE; - if (nla_put_u32(skb, TIPC_NLA_NET_ADDR, val)) - return -EMSGSIZE; - + if (msg->cmd == TIPC_CMD_SET_NODE_ADDR) { + if (nla_put_u32(skb, TIPC_NLA_NET_ADDR, val)) + return -EMSGSIZE; + } else if (msg->cmd == TIPC_CMD_SET_NETID) { + if (nla_put_u32(skb, TIPC_NLA_NET_ID, val)) + return -EMSGSIZE; + } nla_nest_end(skb, net); return 0; @@ -949,6 +954,11 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) doit.doit = tipc_nl_net_set; doit.transcode = tipc_nl_compat_net_set; return tipc_nl_compat_doit(&doit, msg); + case TIPC_CMD_SET_NETID: + msg->req_type = TIPC_TLV_UNSIGNED; + doit.doit = tipc_nl_net_set; + doit.transcode = tipc_nl_compat_net_set; + return tipc_nl_compat_doit(&doit, msg); } return -EOPNOTSUPP; @@ -1059,6 +1069,7 @@ static int tipc_nl_compat_tmp_wrap(struct sk_buff *skb, struct genl_info *info) case TIPC_CMD_GET_MEDIA_NAMES: case TIPC_CMD_GET_NODES: case TIPC_CMD_SET_NODE_ADDR: + case TIPC_CMD_SET_NETID: return tipc_nl_compat_recv(skb, info); } |