aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-10 13:46:21 +0000
committerDamjan Marion <dmarion@me.com>2019-07-11 17:21:02 +0000
commita4d2431594e492c3243f97881fb3ba66e3b4fd76 (patch)
treec9321c65ebda0dfb18348ec95c83d178487ba874 /src/vnet/ipsec/ipsec_api.c
parentd2029bc9c5947a8a676208bada9386e07ec16c97 (diff)
ipsec: Revert "IPSEC: remove byte swap operations in DP during SPD classify"
Type: fix Fixes: 231c4696872cb344f28648949603840136c0795d This reverts commit 231c4696872cb344f28648949603840136c0795d. Change-Id: I136344555983dd10a31dbc000ee40e2de2c91291 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_api.c')
-rw-r--r--src/vnet/ipsec/ipsec_api.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c
index 99e25f1b17a..6de0203602e 100644
--- a/src/vnet/ipsec/ipsec_api.c
+++ b/src/vnet/ipsec/ipsec_api.c
@@ -278,11 +278,10 @@ static void vl_api_ipsec_spd_entry_add_del_t_handler
p.is_ipv6 = (itype == IP46_TYPE_IP6);
p.protocol = mp->entry.protocol;
- /* leave the ports in network order */
- p.rport.start = mp->entry.remote_port_start;
- p.rport.stop = mp->entry.remote_port_stop;
- p.lport.start = mp->entry.local_port_start;
- p.lport.stop = mp->entry.local_port_stop;
+ p.rport.start = ntohs (mp->entry.remote_port_start);
+ p.rport.stop = ntohs (mp->entry.remote_port_stop);
+ p.lport.start = ntohs (mp->entry.local_port_start);
+ p.lport.stop = ntohs (mp->entry.local_port_stop);
rv = ipsec_spd_action_decode (mp->entry.policy, &p.policy);
@@ -616,10 +615,10 @@ send_ipsec_spd_details (ipsec_policy_t * p, vl_api_registration_t * reg,
&mp->entry.remote_address_start);
ip_address_encode (&p->raddr.stop, IP46_TYPE_ANY,
&mp->entry.remote_address_stop);
- mp->entry.local_port_start = p->lport.start;
- mp->entry.local_port_stop = p->lport.stop;
- mp->entry.remote_port_start = p->rport.start;
- mp->entry.remote_port_stop = p->rport.stop;
+ mp->entry.local_port_start = htons (p->lport.start);
+ mp->entry.local_port_stop = htons (p->lport.stop);
+ mp->entry.remote_port_start = htons (p->rport.start);
+ mp->entry.remote_port_stop = htons (p->rport.stop);
mp->entry.protocol = p->protocol;
mp->entry.policy = ipsec_spd_action_encode (p->policy);
mp->entry.sa_id = htonl (p->sa_id);