[ovs-dev,v2,07/11] dpif-netlink: Implement ct_flush.
diff mbox

Message ID 1446779562-3837-8-git-send-email-diproiettod@vmware.com
State Deferred
Headers show

Commit Message

Daniele Di Proietto Nov. 6, 2015, 3:12 a.m. UTC
This member function is used by the ct-dpif module to provide its
services.  It's implemented using the netlink-conntrack module.

N.B. The Linux kernel datapaths share the connection tracker among them
and with the rest of the system.  Therefore the operations are not
really dpif specific.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
---
 lib/dpif-netlink.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Patch
diff mbox

diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
index 189506c..99457b9 100644
--- a/lib/dpif-netlink.c
+++ b/lib/dpif-netlink.c
@@ -2331,6 +2331,16 @@  dpif_netlink_ct_dump_done(struct dpif *dpif OVS_UNUSED,
     return err;
 }
 
+static int
+dpif_netlink_ct_flush(struct dpif *dpif OVS_UNUSED, const uint16_t *zone)
+{
+    if (zone) {
+        return nl_ct_flush_zone(*zone);
+    } else {
+        return nl_ct_flush();
+    }
+}
+
 const struct dpif_class dpif_netlink_class = {
     "system",
     NULL,                       /* init */
@@ -2374,7 +2384,7 @@  const struct dpif_class dpif_netlink_class = {
     dpif_netlink_ct_dump_start,
     dpif_netlink_ct_dump_next,
     dpif_netlink_ct_dump_done,
-    NULL,                       /* ct_flush */
+    dpif_netlink_ct_flush,
 };
 
 static int