On 03/24/2014 07:56 PM, Jarno Rajahalme wrote:
Use netlink_has_listeners() and NLM_F_ECHO flag to determine if a
reply is needed or not for OVS_FLOW_CMD_NEW, OVS_FLOW_CMD_SET, or
OVS_FLOW_CMD_DEL.
Note: This may need compat support for older kernels.
Signed-off-by: Jarno Rajahalme <jrajaha...@nicira.com>
Change looks sane to me. Compatibility is an issue here as
genl_notify() has already dropped the unicast reply if NLM_F_ECHO was
not present before this patch.
Acked-by: Thomas Graf <tg...@redhat.com>
---
datapath/datapath.c | 57 ++++++++++++++++++++++++++++++++++++---------------
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 7ce3ea6..f933831 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -64,6 +64,15 @@
int ovs_net_id __read_mostly;
+/* Check if need to build a reply message.
+ * OVS userspace sets the NLM_F_ECHO flag if it needs the reply. */
+static bool ovs_must_build_reply(struct genl_info *info,
+ const struct genl_multicast_group *grp)
+{
+ return info->nlhdr->nlmsg_flags & NLM_F_ECHO ||
This should use nlmsg_report()
+ netlink_has_listeners(genl_info_net(info)->genl_sock, grp->id);
+}
+
static void ovs_notify(struct sk_buff *skb, struct genl_info *info,
struct genl_multicast_group *grp)
{
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev