summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Valerio <pvalerio@redhat.com>2022-10-26 10:44:09 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-11-02 19:46:43 +0100
commit869e2e1ba0c3d2ea91160da902d9d0a9cd43fd07 (patch)
tree2d248efb6aa6ddfb96b5e440e0db52a705b1e92e
parent0aa55709fc723f540865044ddf62a3d58f1ab75a (diff)
downloadopenvswitch-869e2e1ba0c3d2ea91160da902d9d0a9cd43fd07.tar.gz
odp-util: Add missing separator in format_odp_conntrack_action().
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> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--lib/odp-util.c2
-rw-r--r--tests/odp.at2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c
index 2d2a6893c..3bbc9a101 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -1003,7 +1003,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 4d08c59ca..fce6a4f2b 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))