diff options
author | Filip Varga <fivarga@cisco.com> | 2019-06-11 10:45:21 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-06-12 11:13:42 +0000 |
commit | c299470d5ef437ceaed3d010a2d39f7f52e6776c (patch) | |
tree | ae492573a93adfab15a4c950f9eb4b8e04bd6e38 | |
parent | 7d2420f97fae1a535428b756139a910fc9a120e3 (diff) |
NAT: interface fib fix (VPP-1691)
Change-Id: I2d1e2addb2e440c23c255ac7709169f7909cb0be
Signed-off-by: Filip Varga <fivarga@cisco.com>
-rwxr-xr-x | src/plugins/nat/nat.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c index deed87ece6b..eff81f87daf 100755 --- a/src/plugins/nat/nat.c +++ b/src/plugins/nat/nat.c @@ -2168,6 +2168,7 @@ snat_update_outside_fib (u32 sw_if_index, u32 new_fib_index, nat_outside_fib_t *outside_fib; snat_interface_t *i; u8 is_add = 1; + u8 match = 0; if (new_fib_index == old_fib_index) return; @@ -2175,14 +2176,21 @@ snat_update_outside_fib (u32 sw_if_index, u32 new_fib_index, if (!vec_len (sm->outside_fibs)) return; - pool_foreach (i, sm->interfaces, ( - { - if (i->sw_if_index == sw_if_index) - { - if (!(nat_interface_is_outside (i))) - return;} - } - )); + /* *INDENT-OFF* */ + pool_foreach (i, sm->interfaces, + ({ + if (i->sw_if_index == sw_if_index) + { + if (!(nat_interface_is_outside (i))) + return; + match = 1; + } + })); + /* *INDENT-ON* */ + + if (!match) + return; + vec_foreach (outside_fib, sm->outside_fibs) { if (outside_fib->fib_index == old_fib_index) |