aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/snat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/snat/snat.c')
-rw-r--r--src/plugins/snat/snat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/snat/snat.c b/src/plugins/snat/snat.c
index fc9f58687e4..16fbbdf6599 100644
--- a/src/plugins/snat/snat.c
+++ b/src/plugins/snat/snat.c
@@ -1622,7 +1622,7 @@ vl_api_snat_det_forward_t_handler
snat_main_t * sm = &snat_main;
vl_api_snat_det_forward_reply_t * rmp;
int rv = 0;
- u16 lo_port = 0;
+ u16 lo_port = 0, hi_port = 0;
snat_det_map_t * dm;
ip4_address_t in_addr, out_addr;
@@ -1636,12 +1636,13 @@ vl_api_snat_det_forward_t_handler
}
snat_det_forward(dm, &in_addr, &out_addr, &lo_port);
+ hi_port = lo_port + dm->ports_per_host - 1;
send_reply:
REPLY_MACRO2(VL_API_SNAT_DET_FORWARD_REPLY,
({
rmp->out_port_lo = ntohs(lo_port);
- rmp->out_port_hi = ntohs(lo_port + dm->ports_per_host - 1);
+ rmp->out_port_hi = ntohs(hi_port);
rmp->is_ip4 = 1;
memset(rmp->out_addr, 0, 16);
clib_memcpy(rmp->out_addr, &out_addr, 4);