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

openvswitch: fix conntrack netlink event delivery

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

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: 7f8a436e ("openvswitch: Add conntrack action")
CC: Joe Stringer <>
CC: Justin Pettit <>
CC: Andy Zhou <>
CC: Thomas Graf <>
Signed-off-by: default avatarSamuel Gauthier <>
Acked-by: default avatarJoe Stringer <>
Signed-off-by: default avatarDavid S. Miller <>
parent 34c7bb47
......@@ -818,8 +818,18 @@ static int ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
__ovs_ct_update_key(key, state, &info->zone, exp->master);
} else
return __ovs_ct_lookup(net, key, info, skb);
} 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)
return 0;
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