[GENL]: Add genlmsg_reply() to simply unicast replies to requests
authorThomas Graf <tgraf@suug.ch>
Wed, 15 Nov 2006 03:45:27 +0000 (19:45 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:22:41 +0000 (21:22 -0800)
A generic netlink user has no interest in knowing how to
address the source of the original request.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/genetlink.h
net/netlabel/netlabel_cipso_v4.c
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_unlabeled.c
net/netlink/genetlink.c

index 2010465fa7d46fa5444553b358e99246b7f414c4..797c18b5041fdf060ae9d160c11c33aac8bb2100 100644 (file)
@@ -149,6 +149,16 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
        return nlmsg_unicast(genl_sock, skb, pid);
 }
 
+/**
+ * genlmsg_reply - reply to a request
+ * @skb: netlink message to be sent back
+ * @info: receiver information
+ */
+static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
+{
+       return genlmsg_unicast(skb, info->snd_pid);
+}
+
 /**
  * gennlmsg_data - head of message payload
  * @gnlh: genetlink messsage header
index f1788bd290f88dc0c7aa7efa18775613b1336fad..52628878524c9f48b1dd391ea11fd1562839c05f 100644 (file)
@@ -568,7 +568,7 @@ list_start:
 
        genlmsg_end(ans_skb, data);
 
-       ret_val = genlmsg_unicast(ans_skb, info->snd_pid);
+       ret_val = genlmsg_reply(ans_skb, info);
        if (ret_val != 0)
                goto list_failure;
 
index c529622ff0b717831e899c1f23bf4f26e62af8af..784693735e0d586bbb1fc89cc946b0e2c37f4c1f 100644 (file)
@@ -390,7 +390,7 @@ static int netlbl_mgmt_listdef(struct sk_buff *skb, struct genl_info *info)
 
        genlmsg_end(ans_skb, data);
 
-       ret_val = genlmsg_unicast(ans_skb, info->snd_pid);
+       ret_val = genlmsg_reply(ans_skb, info);
        if (ret_val != 0)
                goto listdef_failure;
        return 0;
@@ -512,7 +512,7 @@ static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info)
 
        genlmsg_end(ans_skb, data);
 
-       ret_val = genlmsg_unicast(ans_skb, info->snd_pid);
+       ret_val = genlmsg_reply(ans_skb, info);
        if (ret_val != 0)
                goto version_failure;
        return 0;
index 219dccade4e18899a8000c607892cdeba14872cd..57dd07b51be61852c62d1e78e7af309d5e439c3c 100644 (file)
@@ -160,7 +160,7 @@ static int netlbl_unlabel_list(struct sk_buff *skb, struct genl_info *info)
 
        genlmsg_end(ans_skb, data);
 
-       ret_val = genlmsg_unicast(ans_skb, info->snd_pid);
+       ret_val = genlmsg_reply(ans_skb, info);
        if (ret_val != 0)
                goto list_failure;
        return 0;
index 70d60c818897666aee617390c627e01cd4be59ec..0249a56a9aad3a98c1c27670e726fe91ee6b8ea1 100644 (file)
@@ -529,7 +529,7 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info)
                goto errout;
        }
 
-       err = genlmsg_unicast(msg, info->snd_pid);
+       err = genlmsg_reply(msg, info);
 errout:
        return err;
 }