diff mbox series

[ovs-dev,v2] odp-util: Add missing separator in format_odp_conntrack_action()

Message ID 166677384931.806968.5359905777279608036.stgit@fed.void
State Accepted
Commit 0bd4155f560fe5fb790b2f714d3682008b6ce736
Headers show
Series [ovs-dev,v2] odp-util: Add missing separator in format_odp_conntrack_action() | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Paolo Valerio Oct. 26, 2022, 8:44 a.m. UTC
If OVS_CT_ATTR_TIMEOUT is included, the resulting output is
the following:

actions:ct(commit,timeout=1nat(src=10.1.1.240))

Fix it by trivially adding a trailing ',' to timeout as well.

Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
---
v2: added test case in odp.at
---
 lib/odp-util.c |    2 +-
 tests/odp.at   |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Ilya Maximets Nov. 2, 2022, 10:51 p.m. UTC | #1
On 10/26/22 10:44, Paolo Valerio wrote:
> If OVS_CT_ATTR_TIMEOUT is included, the resulting output is
> the following:
> 
> actions:ct(commit,timeout=1nat(src=10.1.1.240))
> 
> Fix it by trivially adding a trailing ',' to timeout as well.
> 
> Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
> ---
> v2: added test case in odp.at
> ---
>  lib/odp-util.c |    2 +-
>  tests/odp.at   |    2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)


Thanks!  Applied and backported down to 2.17.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/lib/odp-util.c b/lib/odp-util.c
index ba5be4bb3..72e076e1c 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -1004,7 +1004,7 @@  format_odp_conntrack_action(struct ds *ds, const struct nlattr *attr)
             ds_put_format(ds, "helper=%s,", helper);
         }
         if (timeout) {
-            ds_put_format(ds, "timeout=%s", timeout);
+            ds_put_format(ds, "timeout=%s,", timeout);
         }
         if (nat) {
             format_odp_ct_nat(ds, nat);
diff --git a/tests/odp.at b/tests/odp.at
index 7a1cf3b2c..88b7cfd91 100644
--- a/tests/odp.at
+++ b/tests/odp.at
@@ -348,7 +348,9 @@  ct(commit,helper=tftp)
 ct(commit,timeout=ovs_tp_1_tcp4)
 ct(nat)
 ct(commit,nat(src))
+ct(commit,timeout=ovs_tp_1_tcp4,nat(src))
 ct(commit,nat(dst))
+ct(commit,timeout=ovs_tp_1_tcp4,nat(dst))
 ct(commit,nat(src=10.0.0.240,random))
 ct(commit,nat(src=10.0.0.240:32768-65535,random))
 ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash))