aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/netlink.c
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2015-01-09 02:27:04 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-12 16:24:32 -0500
commitc93d3baa24095887005647984cff5de8c63d3611 (patch)
tree1c7917d92605991696960243fe97dfef9d14913a /net/tipc/netlink.c
parent54fef04ad05f15984082c225fe47ce6af8ea1c5c (diff)
tipc: involve namespace infrastructure
Involve namespace infrastructure, make the "tipc_net_id" global variable aware of per namespace, and rename it to "net_id". In order that the conversion can be successfully done, an instance of networking namespace must be passed to relevant functions, allowing them to access the "net_id" variable of per namespace. Signed-off-by: Ying Xue <ying.xue@windriver.com> Tested-by: Tero Aho <Tero.Aho@coriant.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/netlink.c')
-rw-r--r--net/tipc/netlink.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index b891e3905bc4..282b59681484 100644
--- a/net/tipc/netlink.c
+++ b/net/tipc/netlink.c
@@ -46,6 +46,7 @@
46 46
47static int handle_cmd(struct sk_buff *skb, struct genl_info *info) 47static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
48{ 48{
49 struct net *net = genl_info_net(info);
49 struct sk_buff *rep_buf; 50 struct sk_buff *rep_buf;
50 struct nlmsghdr *rep_nlh; 51 struct nlmsghdr *rep_nlh;
51 struct nlmsghdr *req_nlh = info->nlhdr; 52 struct nlmsghdr *req_nlh = info->nlhdr;
@@ -58,10 +59,11 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
58 else 59 else
59 cmd = req_userhdr->cmd; 60 cmd = req_userhdr->cmd;
60 61
61 rep_buf = tipc_cfg_do_cmd(req_userhdr->dest, cmd, 62 rep_buf = tipc_cfg_do_cmd(net, req_userhdr->dest, cmd,
62 nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN, 63 nlmsg_data(req_nlh) + GENL_HDRLEN +
63 nlmsg_attrlen(req_nlh, GENL_HDRLEN + TIPC_GENL_HDRLEN), 64 TIPC_GENL_HDRLEN,
64 hdr_space); 65 nlmsg_attrlen(req_nlh, GENL_HDRLEN +
66 TIPC_GENL_HDRLEN), hdr_space);
65 67
66 if (rep_buf) { 68 if (rep_buf) {
67 skb_push(rep_buf, hdr_space); 69 skb_push(rep_buf, hdr_space);