diff options
author | Per Liden <per.liden@nospam.ericsson.com> | 2006-01-05 10:34:00 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-12 17:06:32 -0500 |
commit | 1dba9743337cabacea79e47ed6d709e636c5ed47 (patch) | |
tree | b5244bd1e0b798553a3ab8627b0b06ddbe52a749 | |
parent | b97bf3fd8f6a16966d4f18983b2c40993ff937d4 (diff) |
[TIPC] Use dynamically allocated family id with NETLINK_GENERIC
Signed-off-by: Per Liden <per.liden@nospam.ericsson.com>
-rw-r--r-- | include/linux/tipc.h | 1 | ||||
-rw-r--r-- | net/tipc/netlink.c | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index ca754f3317f2..1faab77626f2 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
@@ -539,7 +539,6 @@ static inline void TLV_LIST_STEP(struct tlv_list_desc *list) | |||
539 | * Configuration messages exchanged via NETLINK_GENERIC use the following | 539 | * Configuration messages exchanged via NETLINK_GENERIC use the following |
540 | * family id, name, version and command. | 540 | * family id, name, version and command. |
541 | */ | 541 | */ |
542 | #define TIPC_GENL_FAMILY 0x222 | ||
543 | #define TIPC_GENL_NAME "TIPC" | 542 | #define TIPC_GENL_NAME "TIPC" |
544 | #define TIPC_GENL_VERSION 0x1 | 543 | #define TIPC_GENL_VERSION 0x1 |
545 | #define TIPC_GENL_CMD 0x1 | 544 | #define TIPC_GENL_CMD 0x1 |
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 35fbc7933604..08b974ed9109 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
@@ -40,7 +40,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info) | |||
40 | struct nlmsghdr *rep_nlh; | 40 | struct nlmsghdr *rep_nlh; |
41 | struct nlmsghdr *req_nlh = info->nlhdr; | 41 | struct nlmsghdr *req_nlh = info->nlhdr; |
42 | struct tipc_genlmsghdr *req_userhdr = info->userhdr; | 42 | struct tipc_genlmsghdr *req_userhdr = info->userhdr; |
43 | int hdr_space = NLMSG_SPACE(0); | 43 | int hdr_space = NLMSG_SPACE(GENL_HDRLEN + TIPC_GENL_HDRLEN); |
44 | 44 | ||
45 | if ((req_userhdr->cmd & 0xC000) && (!capable(CAP_NET_ADMIN))) | 45 | if ((req_userhdr->cmd & 0xC000) && (!capable(CAP_NET_ADMIN))) |
46 | rep_buf = cfg_reply_error_string(TIPC_CFG_NOT_NET_ADMIN); | 46 | rep_buf = cfg_reply_error_string(TIPC_CFG_NOT_NET_ADMIN); |
@@ -63,7 +63,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info) | |||
63 | } | 63 | } |
64 | 64 | ||
65 | static struct genl_family family = { | 65 | static struct genl_family family = { |
66 | .id = TIPC_GENL_FAMILY, | 66 | .id = GENL_ID_GENERATE, |
67 | .name = TIPC_GENL_NAME, | 67 | .name = TIPC_GENL_NAME, |
68 | .version = TIPC_GENL_VERSION, | 68 | .version = TIPC_GENL_VERSION, |
69 | .hdrsize = TIPC_GENL_HDRLEN, | 69 | .hdrsize = TIPC_GENL_HDRLEN, |