ipsec: Revert "IPSEC: remove double byte swap of IP addresses"

This reverts commit 9b208ced585d3b4620d6fde586cd047fe2027ecf.

Type: fix
Fixes: 9b208ced585d3b4620d6fde586cd047fe2027ecf

Change-Id: I94a17039b4727bff0877423da5ba6cfceb188b17
Signed-off-by: Neale Ranns <nranns@cisco.com>
diff --git a/src/vnet/ipsec/ipsec_input.c b/src/vnet/ipsec/ipsec_input.c
index cfbda31..47220db 100644
--- a/src/vnet/ipsec/ipsec_input.c
+++ b/src/vnet/ipsec/ipsec_input.c
@@ -86,25 +86,25 @@
 
     if (ipsec_sa_is_set_IS_TUNNEL (s))
       {
-	if (da != s->tunnel_dst_addr.ip4.as_u32)
+	if (da != clib_net_to_host_u32 (s->tunnel_dst_addr.ip4.as_u32))
 	  continue;
 
-	if (sa != s->tunnel_src_addr.ip4.as_u32)
+	if (sa != clib_net_to_host_u32 (s->tunnel_src_addr.ip4.as_u32))
 	  continue;
 
 	return p;
       }
 
-    if (da < p->laddr.start.ip4.as_u32)
+    if (da < clib_net_to_host_u32 (p->laddr.start.ip4.as_u32))
       continue;
 
-    if (da > p->laddr.stop.ip4.as_u32)
+    if (da > clib_net_to_host_u32 (p->laddr.stop.ip4.as_u32))
       continue;
 
-    if (sa < p->raddr.start.ip4.as_u32)
+    if (sa < clib_net_to_host_u32 (p->raddr.start.ip4.as_u32))
       continue;
 
-    if (sa > p->raddr.stop.ip4.as_u32)
+    if (sa > clib_net_to_host_u32 (p->raddr.stop.ip4.as_u32))
       continue;
 
     return p;
@@ -233,8 +233,12 @@
 	      /* FIXME TODO missing check whether there is enough data inside
 	       * IP/UDP to contain ESP header & stuff ? */
 	      p0 = ipsec_input_protect_policy_match (spd0,
-						     ip0->src_address.as_u32,
-						     ip0->dst_address.as_u32,
+						     clib_net_to_host_u32
+						     (ip0->src_address.
+						      as_u32),
+						     clib_net_to_host_u32
+						     (ip0->dst_address.
+						      as_u32),
 						     clib_net_to_host_u32
 						     (esp0->spi));
 
@@ -279,8 +283,12 @@
 	    {
 	      ah0 = (ah_header_t *) ((u8 *) ip0 + ip4_header_bytes (ip0));
 	      p0 = ipsec_input_protect_policy_match (spd0,
-						     ip0->src_address.as_u32,
-						     ip0->dst_address.as_u32,
+						     clib_net_to_host_u32
+						     (ip0->src_address.
+						      as_u32),
+						     clib_net_to_host_u32
+						     (ip0->dst_address.
+						      as_u32),
 						     clib_net_to_host_u32
 						     (ah0->spi));