Commit 9b67aa4a authored by Samuel Gauthier's avatar Samuel Gauthier Committed by David S. Miller

openvswitch: restore OVS_FLOW_CMD_NEW notifications

Since commit fb5d1e9e ("openvswitch: Build flow cmd netlink reply only if needed."),
the new flows are not notified to the listeners of OVS_FLOW_MCGROUP.

This commit fixes the problem by using the genl function, ie
genl_has_listerners() instead of netlink_has_listeners().
Signed-off-by: default avatarSamuel Gauthier <samuel.gauthier@6wind.com>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: default avatarPravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0d566379
...@@ -78,11 +78,12 @@ static const struct genl_multicast_group ovs_dp_vport_multicast_group = { ...@@ -78,11 +78,12 @@ static const struct genl_multicast_group ovs_dp_vport_multicast_group = {
/* Check if need to build a reply message. /* Check if need to build a reply message.
* OVS userspace sets the NLM_F_ECHO flag if it needs the reply. */ * OVS userspace sets the NLM_F_ECHO flag if it needs the reply. */
static bool ovs_must_notify(struct genl_info *info, static bool ovs_must_notify(struct genl_family *family, struct genl_info *info,
const struct genl_multicast_group *grp) unsigned int group)
{ {
return info->nlhdr->nlmsg_flags & NLM_F_ECHO || return info->nlhdr->nlmsg_flags & NLM_F_ECHO ||
netlink_has_listeners(genl_info_net(info)->genl_sock, 0); genl_has_listeners(family, genl_info_net(info)->genl_sock,
group);
} }
static void ovs_notify(struct genl_family *family, static void ovs_notify(struct genl_family *family,
...@@ -763,7 +764,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(const struct sw_flow_actions *act ...@@ -763,7 +764,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(const struct sw_flow_actions *act
{ {
struct sk_buff *skb; struct sk_buff *skb;
if (!always && !ovs_must_notify(info, &ovs_dp_flow_multicast_group)) if (!always && !ovs_must_notify(&dp_flow_genl_family, info, 0))
return NULL; return NULL;
skb = genlmsg_new_unicast(ovs_flow_cmd_msg_size(acts), info, GFP_KERNEL); skb = genlmsg_new_unicast(ovs_flow_cmd_msg_size(acts), info, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment