netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Thomas Graf <tgraf@suug.ch>
Subject: [PATCH 2/3] [GENL]: Add genlmsg_reply() to simply unicast replies to requests
Date: Tue, 14 Nov 2006 12:46:30 +0100	[thread overview]
Message-ID: <20061114114657.817678128@lsx.localdomain> (raw)
In-Reply-To: 20061114114628.033840590@lsx.localdomain

[-- Attachment #1: genlmsg_reply --]
[-- Type: text/plain, Size: 2875 bytes --]

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>

Index: net-2.6.20/include/net/genetlink.h
===================================================================
--- net-2.6.20.orig/include/net/genetlink.h	2006-11-14 12:23:56.000000000 +0100
+++ net-2.6.20/include/net/genetlink.h	2006-11-14 12:46:16.000000000 +0100
@@ -150,6 +150,16 @@
 }
 
 /**
+ * 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: net-2.6.20/net/netlabel/netlabel_cipso_v4.c
===================================================================
--- net-2.6.20.orig/net/netlabel/netlabel_cipso_v4.c	2006-11-14 12:23:43.000000000 +0100
+++ net-2.6.20/net/netlabel/netlabel_cipso_v4.c	2006-11-14 12:46:02.000000000 +0100
@@ -568,7 +568,7 @@
 
 	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: net-2.6.20/net/netlink/genetlink.c
===================================================================
--- net-2.6.20.orig/net/netlink/genetlink.c	2006-11-14 12:23:43.000000000 +0100
+++ net-2.6.20/net/netlink/genetlink.c	2006-11-14 12:46:02.000000000 +0100
@@ -529,7 +529,7 @@
 		goto errout;
 	}
 
-	err = genlmsg_unicast(msg, info->snd_pid);
+	err = genlmsg_reply(msg, info);
 errout:
 	return err;
 }
Index: net-2.6.20/net/netlabel/netlabel_mgmt.c
===================================================================
--- net-2.6.20.orig/net/netlabel/netlabel_mgmt.c	2006-11-14 12:23:43.000000000 +0100
+++ net-2.6.20/net/netlabel/netlabel_mgmt.c	2006-11-14 12:46:02.000000000 +0100
@@ -390,7 +390,7 @@
 
 	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 @@
 
 	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: net-2.6.20/net/netlabel/netlabel_unlabeled.c
===================================================================
--- net-2.6.20.orig/net/netlabel/netlabel_unlabeled.c	2006-11-14 12:23:43.000000000 +0100
+++ net-2.6.20/net/netlabel/netlabel_unlabeled.c	2006-11-14 12:46:02.000000000 +0100
@@ -160,7 +160,7 @@
 
 	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;

--


  parent reply	other threads:[~2006-11-14 11:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 11:46 Generic Netlink Updates Thomas Graf
2006-11-14 11:46 ` [PATCH 1/3] [GENL]: Add genlmsg_new() to allocate generic netlink messages Thomas Graf
2006-11-14 11:46 ` Thomas Graf [this message]
2006-11-14 11:46 ` [PATCH 3/3] [GENL]: Add genlmsg_put_reply() to simplify building reply headers Thomas Graf
2006-11-14 17:23 ` Generic Netlink Updates Paul Moore
2006-11-15  3:46   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061114114657.817678128@lsx.localdomain \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).