aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_rules_table.c
diff options
context:
space:
mode:
authorMilan Lenco <milan.lenco@pantheon.tech>2017-11-24 17:12:33 +0100
committerFlorin Coras <florin.coras@gmail.com>2017-11-26 20:48:08 +0000
commit8b9a5d198cc316d36b93f19fee7a351fc3922e4a (patch)
tree5f8cf5b482c6d9795c5d523c82cc89fec16e820d /src/vnet/session/session_rules_table.c
parent6bcac065b82ef2e48fc23db18534d9dc9a7833a1 (diff)
Fix session rule port endianness.
Change-Id: I43a7ac5b6c33810a465568d1955f400f4ef08786 Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Diffstat (limited to 'src/vnet/session/session_rules_table.c')
-rw-r--r--src/vnet/session/session_rules_table.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vnet/session/session_rules_table.c b/src/vnet/session/session_rules_table.c
index fa8a056fbf0..abe2a2bb7af 100644
--- a/src/vnet/session/session_rules_table.c
+++ b/src/vnet/session/session_rules_table.c
@@ -128,10 +128,11 @@ format_session_rule4 (u8 * s, va_list * args)
s = format (s, "[%d] rule: %U/%d %d %U/%d %d action: %d tag: %v", ri,
format_ip4_address, &match->lcl_ip,
- ip4_mask_to_preflen (&mask->lcl_ip), match->lcl_port,
- format_ip4_address, &match->rmt_ip,
- ip4_mask_to_preflen (&mask->rmt_ip), match->rmt_port,
- sr->action_index, tag ? tag : null_tag);
+ ip4_mask_to_preflen (&mask->lcl_ip),
+ clib_net_to_host_u16 (match->lcl_port), format_ip4_address,
+ &match->rmt_ip, ip4_mask_to_preflen (&mask->rmt_ip),
+ clib_net_to_host_u16 (match->rmt_port), sr->action_index,
+ tag ? tag : null_tag);
if (vec_len (sr->next_indices))
{
s = format (s, "\n children: ");
@@ -161,10 +162,11 @@ format_session_rule6 (u8 * s, va_list * args)
s = format (s, "[%d] rule: %U/%d %d %U/%d %d action: %d tag: %v", ri,
format_ip6_address, &match->lcl_ip,
- ip6_mask_to_preflen (&mask->lcl_ip), match->lcl_port,
- format_ip6_address, &match->rmt_ip,
- ip6_mask_to_preflen (&mask->rmt_ip), match->rmt_port,
- sr->action_index, tag ? tag : null_tag);
+ ip6_mask_to_preflen (&mask->lcl_ip),
+ clib_net_to_host_u16 (match->lcl_port), format_ip6_address,
+ &match->rmt_ip, ip6_mask_to_preflen (&mask->rmt_ip),
+ clib_net_to_host_u16 (match->rmt_port), sr->action_index,
+ tag ? tag : null_tag);
if (vec_len (sr->next_indices))
{
s = format (s, "\n children: ");