dpif-netlink: Implement ct_flush.
authorDaniele Di Proietto <diproiettod@vmware.com>
Wed, 28 Oct 2015 17:34:26 +0000 (10:34 -0700)
committerDaniele Di Proietto <diproiettod@vmware.com>
Tue, 22 Dec 2015 01:23:55 +0000 (17:23 -0800)
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>
Acked-by: Joe Stringer <joe@ovn.org>
lib/dpif-netlink.c

index 554c756..5e48393 100644 (file)
@@ -2331,6 +2331,16 @@ dpif_netlink_ct_dump_done(struct dpif *dpif OVS_UNUSED,
     free(dump);
     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();
+    }
+}
 #endif
 
 const struct dpif_class dpif_netlink_class = {
@@ -2377,12 +2387,13 @@ const struct dpif_class dpif_netlink_class = {
     dpif_netlink_ct_dump_start,
     dpif_netlink_ct_dump_next,
     dpif_netlink_ct_dump_done,
+    dpif_netlink_ct_flush,
 #else
     NULL,                       /* ct_dump_start */
     NULL,                       /* ct_dump_next */
     NULL,                       /* ct_dump_done */
-#endif
     NULL,                       /* ct_flush */
+#endif
 };
 
 static int