diff options
author | Neale Ranns <nranns@cisco.com> | 2019-03-18 17:11:28 +0000 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-03-19 14:53:26 +0000 |
commit | 231c4696872cb344f28648949603840136c0795d (patch) | |
tree | e70cec429dfa006c76f3a273ab64646953153a2c /src/vnet/ipsec/ipsec_api.c | |
parent | 9f231d4f147c7e3fdf562680488ec5dfe7655b5e (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_api.c')
-rw-r--r-- | src/vnet/ipsec/ipsec_api.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c index d0f543fe520..e6f5bd31428 100644 --- a/src/vnet/ipsec/ipsec_api.c +++ b/src/vnet/ipsec/ipsec_api.c @@ -150,10 +150,11 @@ static void vl_api_ipsec_spd_entry_add_del_t_handler p.is_ipv6 = (itype == IP46_TYPE_IP6); p.protocol = mp->entry.protocol; - 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); + /* 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; rv = ipsec_spd_action_decode (mp->entry.policy, &p.policy); @@ -481,10 +482,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 = 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.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.protocol = p->protocol; mp->entry.policy = ipsec_spd_action_encode (p->policy); mp->entry.sa_id = htonl (p->sa_id); |