aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-11-14 22:45:27 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:22:41 -0500
commit81878d27fdd297a33f3cfcf29483fe1abaf26dec (patch)
tree4ce8183643abce3ec5fe5fdab0c9104204e88e6e
parent3dabc7157859e706770c825aa229f8943db4e0e1 (diff)
[GENL]: Add genlmsg_reply() to simply unicast replies to requests
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>
-rw-r--r--include/net/genetlink.h10
-rw-r--r--net/netlabel/netlabel_cipso_v4.c2
-rw-r--r--net/netlabel/netlabel_mgmt.c4
-rw-r--r--net/netlabel/netlabel_unlabeled.c2
-rw-r--r--net/netlink/genetlink.c2
5 files changed, 15 insertions, 5 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 2010465fa7d4..797c18b5041f 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -150,6 +150,16 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
150} 150}
151 151
152/** 152/**
153 * genlmsg_reply - reply to a request
154 * @skb: netlink message to be sent back
155 * @info: receiver information
156 */
157static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
158{
159 return genlmsg_unicast(skb, info->snd_pid);
160}
161
162/**
153 * gennlmsg_data - head of message payload 163 * gennlmsg_data - head of message payload
154 * @gnlh: genetlink messsage header 164 * @gnlh: genetlink messsage header
155 */ 165 */
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index f1788bd290f8..52628878524c 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -568,7 +568,7 @@ list_start:
568 568
569 genlmsg_end(ans_skb, data); 569 genlmsg_end(ans_skb, data);
570 570
571 ret_val = genlmsg_unicast(ans_skb, info->snd_pid); 571 ret_val = genlmsg_reply(ans_skb, info);
572 if (ret_val != 0) 572 if (ret_val != 0)
573 goto list_failure; 573 goto list_failure;
574 574
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index c529622ff0b7..784693735e0d 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -390,7 +390,7 @@ static int netlbl_mgmt_listdef(struct sk_buff *skb, struct genl_info *info)
390 390
391 genlmsg_end(ans_skb, data); 391 genlmsg_end(ans_skb, data);
392 392
393 ret_val = genlmsg_unicast(ans_skb, info->snd_pid); 393 ret_val = genlmsg_reply(ans_skb, info);
394 if (ret_val != 0) 394 if (ret_val != 0)
395 goto listdef_failure; 395 goto listdef_failure;
396 return 0; 396 return 0;
@@ -512,7 +512,7 @@ static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info)
512 512
513 genlmsg_end(ans_skb, data); 513 genlmsg_end(ans_skb, data);
514 514
515 ret_val = genlmsg_unicast(ans_skb, info->snd_pid); 515 ret_val = genlmsg_reply(ans_skb, info);
516 if (ret_val != 0) 516 if (ret_val != 0)
517 goto version_failure; 517 goto version_failure;
518 return 0; 518 return 0;
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 219dccade4e1..57dd07b51be6 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -160,7 +160,7 @@ static int netlbl_unlabel_list(struct sk_buff *skb, struct genl_info *info)
160 160
161 genlmsg_end(ans_skb, data); 161 genlmsg_end(ans_skb, data);
162 162
163 ret_val = genlmsg_unicast(ans_skb, info->snd_pid); 163 ret_val = genlmsg_reply(ans_skb, info);
164 if (ret_val != 0) 164 if (ret_val != 0)
165 goto list_failure; 165 goto list_failure;
166 return 0; 166 return 0;
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 70d60c818897..0249a56a9aad 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -529,7 +529,7 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info)
529 goto errout; 529 goto errout;
530 } 530 }
531 531
532 err = genlmsg_unicast(msg, info->snd_pid); 532 err = genlmsg_reply(msg, info);
533errout: 533errout:
534 return err; 534 return err;
535} 535}