[PATCH Xenial SRU] openvswitch: fix conntrack netlink event delivery
Tim Gardner
tim.gardner at canonical.com
Mon Jul 18 14:14:38 UTC 2016
From: Samuel Gauthier <samuel.gauthier at 6wind.com>
BugLink: http://bugs.launchpad.net/bugs/1603468
Only the first and last netlink message for a particular conntrack are
actually sent. The first message is sent through nf_conntrack_confirm when
the conntrack is committed. The last one is sent when the conntrack is
destroyed on timeout. The other conntrack state change messages are not
advertised.
When the conntrack subsystem is used from netfilter, nf_conntrack_confirm
is called for each packet, from the postrouting hook, which in turn calls
nf_ct_deliver_cached_events to send the state change netlink messages.
This commit fixes the problem by calling nf_ct_deliver_cached_events in the
non-commit case as well.
Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
CC: Joe Stringer <joestringer at nicira.com>
CC: Justin Pettit <jpettit at nicira.com>
CC: Andy Zhou <azhou at nicira.com>
CC: Thomas Graf <tgraf at suug.ch>
Signed-off-by: Samuel Gauthier <samuel.gauthier at 6wind.com>
Acked-by: Joe Stringer <joe at ovn.org>
Signed-off-by: David S. Miller <davem at davemloft.net>
(back ported from commit d913d3a763a6f66a862a6eafcf6da89a7905832a)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
Conflicts:
net/openvswitch/conntrack.c
---
net/openvswitch/conntrack.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index e004067..17c2228 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -442,11 +442,16 @@ static int ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
state = OVS_CS_F_TRACKED | OVS_CS_F_NEW | OVS_CS_F_RELATED;
__ovs_ct_update_key(key, state, &info->zone, exp->master);
} else {
+ struct nf_conn *ct;
int err;
err = __ovs_ct_lookup(net, key, info, skb);
if (err)
return err;
+
+ ct = (struct nf_conn *)skb->nfct;
+ if (ct)
+ nf_ct_deliver_cached_events(ct);
}
return 0;
--
1.9.1
More information about the kernel-team
mailing list