aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/netlink.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index 282b59681484..fe0f5134ce15 100644
--- a/net/tipc/netlink.c
+++ b/net/tipc/netlink.c
@@ -54,7 +54,8 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
54 int hdr_space = nlmsg_total_size(GENL_HDRLEN + TIPC_GENL_HDRLEN); 54 int hdr_space = nlmsg_total_size(GENL_HDRLEN + TIPC_GENL_HDRLEN);
55 u16 cmd; 55 u16 cmd;
56 56
57 if ((req_userhdr->cmd & 0xC000) && (!netlink_capable(skb, CAP_NET_ADMIN))) 57 if ((req_userhdr->cmd & 0xC000) &&
58 (!netlink_net_capable(skb, CAP_NET_ADMIN)))
58 cmd = TIPC_CMD_NOT_NET_ADMIN; 59 cmd = TIPC_CMD_NOT_NET_ADMIN;
59 else 60 else
60 cmd = req_userhdr->cmd; 61 cmd = req_userhdr->cmd;
@@ -70,7 +71,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
70 rep_nlh = nlmsg_hdr(rep_buf); 71 rep_nlh = nlmsg_hdr(rep_buf);
71 memcpy(rep_nlh, req_nlh, hdr_space); 72 memcpy(rep_nlh, req_nlh, hdr_space);
72 rep_nlh->nlmsg_len = rep_buf->len; 73 rep_nlh->nlmsg_len = rep_buf->len;
73 genlmsg_unicast(&init_net, rep_buf, NETLINK_CB(skb).portid); 74 genlmsg_unicast(net, rep_buf, NETLINK_CB(skb).portid);
74 } 75 }
75 76
76 return 0; 77 return 0;
@@ -95,6 +96,7 @@ static struct genl_family tipc_genl_family = {
95 .version = TIPC_GENL_VERSION, 96 .version = TIPC_GENL_VERSION,
96 .hdrsize = TIPC_GENL_HDRLEN, 97 .hdrsize = TIPC_GENL_HDRLEN,
97 .maxattr = 0, 98 .maxattr = 0,
99 .netnsok = true,
98}; 100};
99 101
100/* Legacy ASCII API */ 102/* Legacy ASCII API */
@@ -114,6 +116,7 @@ struct genl_family tipc_genl_v2_family = {
114 .version = TIPC_GENL_V2_VERSION, 116 .version = TIPC_GENL_V2_VERSION,
115 .hdrsize = 0, 117 .hdrsize = 0,
116 .maxattr = TIPC_NLA_MAX, 118 .maxattr = TIPC_NLA_MAX,
119 .netnsok = true,
117}; 120};
118 121
119static const struct genl_ops tipc_genl_v2_ops[] = { 122static const struct genl_ops tipc_genl_v2_ops[] = {