nat: avoid hairpinning infinite loop problem 84/30284/3
authorElias Rudberg <elias.rudberg@bahnhof.net>
Fri, 4 Dec 2020 18:32:55 +0000 (19:32 +0100)
committerOle Tr�an <otroan@employees.org>
Tue, 8 Dec 2020 08:49:24 +0000 (08:49 +0000)
commit9b8cb5082471dd670066b8ba2872ffbcc35a87f8
tree7345bf7e7c5c86cfe7f87ff45bb4c94c42ceacc6
parent3227e49689974e2dd3aea4d85debdf159d532b42
nat: avoid hairpinning infinite loop problem

Fix in nat44 hairpinning code to check if anything was actually
changed in the snat_hairpinning() routine, and return 0 if nothing
changed. This helps avoid an infinite loop repeating the three
nodes nat44-hairpinning-->ip4-lookup-->ip4-local in case there
was no change. Also add a corresponding test case.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I95f48476bd002ac4c6789afe504681f1963e5d38
Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
src/plugins/nat/nat44_hairpinning.c
src/plugins/nat/test/test_nat44.py