diff options
author | Wei Li <realbaseball2008@gmail.com> | 2023-03-08 08:01:01 +0000 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2023-08-26 13:45:55 +0000 |
commit | 942e78aa9848a55b3b6e53cd29a972c136115b56 (patch) | |
tree | 9e9ff40cf4a527cdb6575efb42dd2cf754af7c62 /src/plugins/nat/nat44-ed/nat44_ed_cli.c | |
parent | 19c22a42c283a21aadebc77fe04dbb73ed8179ed (diff) |
nat: nat44-ed cli bug fix
lport and eport in Cli "nat44 add load-balancing static mapping" should hton()
Type: fix
Signed-off-by: Wei Li <realbaseball2008@gmail.com>
Change-Id: I2eadb7e341efb70cc406e10b3b189e5ebff09ff4
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed_cli.c')
-rw-r--r-- | src/plugins/nat/nat44-ed/nat44_ed_cli.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_cli.c b/src/plugins/nat/nat44-ed/nat44_ed_cli.c index 1eac3c323fe..14313d05a35 100644 --- a/src/plugins/nat/nat44-ed/nat44_ed_cli.c +++ b/src/plugins/nat/nat44-ed/nat44_ed_cli.c @@ -1058,6 +1058,7 @@ add_lb_static_mapping_command_fn (vlib_main_t * vm, { clib_memset (&local, 0, sizeof (local)); local.addr = l_addr; + l_port = clib_host_to_net_u16 (l_port); local.port = (u16) l_port; local.probability = (u8) probability; vec_add1 (locals, local); @@ -1068,6 +1069,7 @@ add_lb_static_mapping_command_fn (vlib_main_t * vm, { clib_memset (&local, 0, sizeof (local)); local.addr = l_addr; + l_port = clib_host_to_net_u16 (l_port); local.port = (u16) l_port; local.probability = (u8) probability; local.vrf_id = vrf_id; @@ -1075,7 +1077,9 @@ add_lb_static_mapping_command_fn (vlib_main_t * vm, } else if (unformat (line_input, "external %U:%u", unformat_ip4_address, &e_addr, &e_port)) - ; + { + e_port = clib_host_to_net_u16 (e_port); + } else if (unformat (line_input, "protocol %U", unformat_ip_protocol, &proto)) { |