summaryrefslogtreecommitdiff
path: root/lib/conntrack.c
diff options
context:
space:
mode:
authorEric Garver <e@erig.me>2018-01-19 14:21:51 -0500
committerJustin Pettit <jpettit@ovn.org>2018-01-20 11:16:37 -0800
commit1fe178d251c8500a8ce7fab924e3a726f423026c (patch)
tree748f88d9c7789f332edc8c36f2ef15fd5b84921f /lib/conntrack.c
parent70bbaa46492d25d94154bebd4563d14d3e629068 (diff)
downloadopenvswitch-1fe178d251c8500a8ce7fab924e3a726f423026c.tar.gz
dpif: Add support for OVS_ACTION_ATTR_CT_CLEAR
This supports using the ct_clear action in the kernel datapath. To preserve compatibility with current ct_clear behavior on old kernels, we only pass this action down to the datapath if a probe reveals the datapath actually supports it. Signed-off-by: Eric Garver <e@erig.me> Acked-by: William Tu <u9012063@gmail.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'lib/conntrack.c')
-rw-r--r--lib/conntrack.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/conntrack.c b/lib/conntrack.c
index c89ac43ad..562e76783 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -1325,6 +1325,14 @@ conntrack_execute(struct conntrack *ct, struct dp_packet_batch *pkt_batch,
return 0;
}
+void
+conntrack_clear(struct dp_packet *packet)
+{
+ /* According to pkt_metadata_init(), ct_state == 0 is enough to make all of
+ * the conntrack fields invalid. */
+ packet->md.ct_state = 0;
+}
+
static void
set_mark(struct dp_packet *pkt, struct conn *conn, uint32_t val, uint32_t mask)
{