]> git.proxmox.com Git - mirror_ovs.git/commit - lib/conntrack.c
conntrack: fix ftp ipv4 address substitution.
authorDarrell Ball <dlu998@gmail.com>
Fri, 1 Feb 2019 07:35:40 +0000 (23:35 -0800)
committerBen Pfaff <blp@ovn.org>
Mon, 4 Feb 2019 17:42:49 +0000 (09:42 -0800)
commitcd7c99a6aac6293721016eb2652497d0fda8623c
tree541729e0bc2061a765c6f5005f7967172ba15d0e
parent8411b6ccecdede73e89c4595025f6c72fb2cccc3
conntrack: fix ftp ipv4 address substitution.

When replacing the ipv4 address in repl_ftp_v4_addr(), the remaining size
was incorrectly calculated which could lead to the wrong replacement
adjustment.

This goes unnoticed most of the time, unless you choose carefully your
initial and replacement addresses.

Example fail address combination with 10.1.1.200 DNAT'd to 10.1.100.1.

Fix this by doing something similar to V6 and also splicing out common
code for better coverage and maintainability.

A test is updated to exercise different initial and replacement addresses
and another test is added.

Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.")
Reported-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/conntrack.c
tests/system-traffic.at