[TIPC] Use dynamically allocated family id with NETLINK_GENERIC
authorPer Liden <per.liden@nospam.ericsson.com>
Thu, 5 Jan 2006 15:34:00 +0000 (16:34 +0100)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 12 Jan 2006 22:06:32 +0000 (14:06 -0800)
Signed-off-by: Per Liden <per.liden@nospam.ericsson.com>
include/linux/tipc.h
net/tipc/netlink.c

index ca754f3317f234d8137e7f23f0287e3e7a19884d..1faab77626f24a56fbac1fdc1aab8139ae159a50 100644 (file)
@@ -539,7 +539,6 @@ static inline void TLV_LIST_STEP(struct tlv_list_desc *list)
  * Configuration messages exchanged via NETLINK_GENERIC use the following
  * family id, name, version and command.
  */
-#define TIPC_GENL_FAMILY       0x222
 #define TIPC_GENL_NAME         "TIPC"
 #define TIPC_GENL_VERSION      0x1
 #define TIPC_GENL_CMD          0x1
index 35fbc79336042a0acd54a6a4fba670b5b5e47e58..08b974ed9109be7e315d1df57a5b252f8d17bef1 100644 (file)
@@ -40,7 +40,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
        struct nlmsghdr *rep_nlh;
        struct nlmsghdr *req_nlh = info->nlhdr;
        struct tipc_genlmsghdr *req_userhdr = info->userhdr;
-       int hdr_space = NLMSG_SPACE(0);
+       int hdr_space = NLMSG_SPACE(GENL_HDRLEN + TIPC_GENL_HDRLEN);
 
        if ((req_userhdr->cmd & 0xC000) && (!capable(CAP_NET_ADMIN)))
                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)
 }
 
 static struct genl_family family = {
-        .id            = TIPC_GENL_FAMILY,
+        .id            = GENL_ID_GENERATE,
         .name          = TIPC_GENL_NAME,
         .version       = TIPC_GENL_VERSION,
         .hdrsize       = TIPC_GENL_HDRLEN,