summaryrefslogtreecommitdiff
path: root/lib/conntrack.c
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@redhat.com>2019-01-15 18:58:16 -0800
committerBen Pfaff <blp@ovn.org>2019-01-18 16:16:16 -0800
commitefa29a891031431fb1e69026f3e4d6c17f6f92c2 (patch)
tree3c5c4cfec49e8896dbc8ad91f3350547962fde13 /lib/conntrack.c
parent253e4dc0683b3e9969a2254bfdcf8d699039ff0e (diff)
downloadopenvswitch-efa29a891031431fb1e69026f3e4d6c17f6f92c2.tar.gz
conntrack: fix expectations for ftp+DNAT.
When configuring the nat part of an expectation, care must be taken to look at the master nat action and direction to properly reproduce it. DNAT tests have been added to both active and passive modes, all ftp/tftp tests titles have been updated to reflect they are dealing with SNAT. Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") Co-authored-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/conntrack.c')
-rw-r--r--lib/conntrack.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/conntrack.c b/lib/conntrack.c
index ae549bda3..c6864b9eb 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -2713,21 +2713,29 @@ expectation_create(struct conntrack *ct, ovs_be16 dst_port,
if (reply) {
src_addr = master_conn->key.src.addr;
dst_addr = master_conn->key.dst.addr;
+ alg_exp_node->nat_rpl_dst = true;
if (skip_nat) {
alg_nat_repl_addr = dst_addr;
+ } else if (master_conn->nat_info &&
+ master_conn->nat_info->nat_action & NAT_ACTION_DST) {
+ alg_nat_repl_addr = master_conn->rev_key.src.addr;
+ alg_exp_node->nat_rpl_dst = false;
} else {
alg_nat_repl_addr = master_conn->rev_key.dst.addr;
}
- alg_exp_node->nat_rpl_dst = true;
} else {
src_addr = master_conn->rev_key.src.addr;
dst_addr = master_conn->rev_key.dst.addr;
+ alg_exp_node->nat_rpl_dst = false;
if (skip_nat) {
alg_nat_repl_addr = src_addr;
+ } else if (master_conn->nat_info &&
+ master_conn->nat_info->nat_action & NAT_ACTION_DST) {
+ alg_nat_repl_addr = master_conn->key.dst.addr;
+ alg_exp_node->nat_rpl_dst = true;
} else {
alg_nat_repl_addr = master_conn->key.src.addr;
}
- alg_exp_node->nat_rpl_dst = false;
}
if (src_ip_wc) {
memset(&src_addr, 0, sizeof src_addr);