map: fix translation of icmp4 error messages 45/25845/3
authorAlexander Chernavin <achernavin@netgate.com>
Thu, 12 Mar 2020 12:42:12 +0000 (08:42 -0400)
committerOle Trøan <otroan@employees.org>
Sun, 15 Mar 2020 11:37:17 +0000 (11:37 +0000)
commitcd5a4a035c0c7a7ca9f915bee83abde085c05ad7
tree1977e2afab3b7891769d2ba177a84af1bc7c4eda
parent1e844aa1cef347bb92a404a1d2f40d14ce646c26
map: fix translation of icmp4 error messages

ICMP error messages are translated to ICMPv6 error messages with
erroneous destination address in the outer IPv6 header because sender
port is used instead of receiver port.

Both source and destination addresses in the inner IPv6 header are
translated erroneously because source and destination addresses of the
inner IPv4 header are getting zeroed during the translation.

With this commit, use receiver port for translation and save addresses
of the inner IPv4 header before translation of the inner header.

Type: fix

Change-Id: I1e93d54c1bbc154b401adcbb0fb661299655d01a
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
src/plugins/map/ip4_map_t.c
src/plugins/map/test/test_map_br.py