diff mbox series

[ovs-dev,v7,4/4] dpif-netdev: add all-zero SNAT to the advertised features of ct

Message ID 162426999980.3650320.10129729985974833736.stgit@fed.void
State Changes Requested
Headers show
Series conntrack: add all-zero SNAT | expand

Commit Message

Paolo Valerio June 21, 2021, 10:06 a.m. UTC
Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
---
 lib/dpif-netdev.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Aaron Conole June 21, 2021, 1:20 p.m. UTC | #1
Paolo Valerio <pvalerio@redhat.com> writes:

> Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>

>  lib/dpif-netdev.c |   12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 05de57ed5..3f04bf6ec 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -8250,6 +8250,16 @@ dpif_netdev_ct_del_limits(struct dpif *dpif OVS_UNUSED,
>      return err;
>  }
>  
> +static int
> +dpif_netdev_ct_get_features(struct dpif *dpif OVS_UNUSED,
> +                            enum ct_features *features)
> +{
> +    if (features != NULL) {
> +        *features = CONNTRACK_F_ZERO_SNAT;
> +    }
> +    return 0;
> +}
> +
>  static int
>  dpif_netdev_ct_set_timeout_policy(struct dpif *dpif,
>                                    const struct ct_dpif_timeout_policy *dpif_tp)
> @@ -8515,7 +8525,7 @@ const struct dpif_class dpif_netdev_class = {
>      NULL,                       /* ct_timeout_policy_dump_next */
>      NULL,                       /* ct_timeout_policy_dump_done */
>      dpif_netdev_ct_get_timeout_policy_name,
> -    NULL,                       /* ct_get_features */
> +    dpif_netdev_ct_get_features,
>      dpif_netdev_ipf_set_enabled,
>      dpif_netdev_ipf_set_min_frag,
>      dpif_netdev_ipf_set_max_nfrags,
diff mbox series

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 05de57ed5..3f04bf6ec 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -8250,6 +8250,16 @@  dpif_netdev_ct_del_limits(struct dpif *dpif OVS_UNUSED,
     return err;
 }
 
+static int
+dpif_netdev_ct_get_features(struct dpif *dpif OVS_UNUSED,
+                            enum ct_features *features)
+{
+    if (features != NULL) {
+        *features = CONNTRACK_F_ZERO_SNAT;
+    }
+    return 0;
+}
+
 static int
 dpif_netdev_ct_set_timeout_policy(struct dpif *dpif,
                                   const struct ct_dpif_timeout_policy *dpif_tp)
@@ -8515,7 +8525,7 @@  const struct dpif_class dpif_netdev_class = {
     NULL,                       /* ct_timeout_policy_dump_next */
     NULL,                       /* ct_timeout_policy_dump_done */
     dpif_netdev_ct_get_timeout_policy_name,
-    NULL,                       /* ct_get_features */
+    dpif_netdev_ct_get_features,
     dpif_netdev_ipf_set_enabled,
     dpif_netdev_ipf_set_min_frag,
     dpif_netdev_ipf_set_max_nfrags,