summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat_api.c')
-rw-r--r--src/plugins/nat/nat_api.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c
index 417d2984011..4c815f0bc13 100644
--- a/src/plugins/nat/nat_api.c
+++ b/src/plugins/nat/nat_api.c
@@ -876,7 +876,9 @@ vl_api_nat44_static_mapping_dump_t_handler (vl_api_nat44_static_mapping_dump_t
/* *INDENT-OFF* */
pool_foreach (m, sm->static_mappings,
({
- if (!vec_len(m->locals) && (m->local_addr.as_u32 != m->external_addr.as_u32))
+ if (!vec_len (m->locals) &&
+ ((m->local_port != m->external_port)
+ || (m->local_addr.as_u32 != m->external_addr.as_u32)))
send_nat44_static_mapping_details (m, reg, mp->context);
}));
/* *INDENT-ON* */
@@ -1034,7 +1036,8 @@ static void
/* *INDENT-OFF* */
pool_foreach (m, sm->static_mappings,
({
- if (!vec_len(m->locals) && (m->local_addr.as_u32 == m->external_addr.as_u32))
+ if (!vec_len (m->locals) && (m->local_port == m->external_port)
+ && (m->local_addr.as_u32 == m->external_addr.as_u32))
send_nat44_identity_mapping_details (m, reg, mp->context);
}));
/* *INDENT-ON* */