summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_output.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-18 17:11:28 +0000
committerNeale Ranns <nranns@cisco.com>2019-03-19 14:53:26 +0000
commit231c4696872cb344f28648949603840136c0795d (patch)
treee70cec429dfa006c76f3a273ab64646953153a2c /src/vnet/ipsec/ipsec_output.c
parent9f231d4f147c7e3fdf562680488ec5dfe7655b5e (diff)
IPSEC: remove byte swap operations in DP during SPD classify
Change-Id: I4bfde738f9585b045cb5ba62cf51b141d639b1b2 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_output.c')
-rw-r--r--src/vnet/ipsec/ipsec_output.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/vnet/ipsec/ipsec_output.c b/src/vnet/ipsec/ipsec_output.c
index a2553764192..83ab629453d 100644
--- a/src/vnet/ipsec/ipsec_output.c
+++ b/src/vnet/ipsec/ipsec_output.c
@@ -82,16 +82,16 @@ ipsec_output_policy_match (ipsec_spd_t * spd, u8 pr, u32 la, u32 ra, u16 lp,
if (PREDICT_FALSE (p->protocol && (p->protocol != pr)))
continue;
- if (ra < clib_net_to_host_u32 (p->raddr.start.ip4.as_u32))
+ if (ra < p->raddr.start.ip4.as_u32)
continue;
- if (ra > clib_net_to_host_u32 (p->raddr.stop.ip4.as_u32))
+ if (ra > p->raddr.stop.ip4.as_u32)
continue;
- if (la < clib_net_to_host_u32 (p->laddr.start.ip4.as_u32))
+ if (la < p->laddr.start.ip4.as_u32)
continue;
- if (la > clib_net_to_host_u32 (p->laddr.stop.ip4.as_u32))
+ if (la > p->laddr.stop.ip4.as_u32)
continue;
if (PREDICT_FALSE
@@ -239,10 +239,8 @@ ipsec_output_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
p0 = ipsec6_output_policy_match (spd0,
&ip6_0->src_address,
&ip6_0->dst_address,
- clib_net_to_host_u16
- (udp0->src_port),
- clib_net_to_host_u16
- (udp0->dst_port), ip6_0->protocol);
+ udp0->src_port,
+ udp0->dst_port, ip6_0->protocol);
}
else
{
@@ -258,14 +256,9 @@ ipsec_output_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
#endif
p0 = ipsec_output_policy_match (spd0, ip0->protocol,
- clib_net_to_host_u32
- (ip0->src_address.as_u32),
- clib_net_to_host_u32
- (ip0->dst_address.as_u32),
- clib_net_to_host_u16
- (udp0->src_port),
- clib_net_to_host_u16
- (udp0->dst_port));
+ ip0->src_address.as_u32,
+ ip0->dst_address.as_u32,
+ udp0->src_port, udp0->dst_port);
}
tcp0 = (void *) udp0;