summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_api.c
diff options
context:
space:
mode:
authorKingwel Xie <kingwel.xie@ericsson.com>2019-03-20 07:21:58 -0400
committerNeale Ranns <nranns@cisco.com>2019-03-21 07:42:09 +0000
commit1ba5bc8d888d0164dd6e38857cbed09ab7ce1d8b (patch)
treeea87c57b0db7f981878e2cdb66f7f650cbc71447 /src/vnet/ipsec/ipsec_api.c
parenta5efca30f569ff93cfb85ed1bc7742cee824426d (diff)
ipsec: add ipv6 support for ipsec tunnel interface
Change-Id: I6a76907dc7bed2a81282b63669bea2219d6903c9 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com> Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_api.c')
-rw-r--r--src/vnet/ipsec/ipsec_api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c
index e6f5bd31428..4bb3a75b936 100644
--- a/src/vnet/ipsec/ipsec_api.c
+++ b/src/vnet/ipsec/ipsec_api.c
@@ -616,6 +616,7 @@ vl_api_ipsec_tunnel_if_add_del_t_handler (vl_api_ipsec_tunnel_if_add_del_t *
ipsec_main_t *im = &ipsec_main;
vnet_main_t *vnm = im->vnet_main;
u32 sw_if_index = ~0;
+ ip46_type_t itype;
int rv;
#if WITH_LIBSSL > 0
@@ -636,8 +637,9 @@ vl_api_ipsec_tunnel_if_add_del_t_handler (vl_api_ipsec_tunnel_if_add_del_t *
tun.remote_integ_key_len = mp->remote_integ_key_len;
tun.udp_encap = mp->udp_encap;
tun.tx_table_id = ntohl (mp->tx_table_id);
- memcpy (&tun.local_ip.ip4, mp->local_ip, 4);
- memcpy (&tun.remote_ip.ip4, mp->remote_ip, 4);
+ itype = ip_address_decode (&mp->local_ip, &tun.local_ip);
+ itype = ip_address_decode (&mp->remote_ip, &tun.remote_ip);
+ tun.is_ip6 = (IP46_TYPE_IP6 == itype);
memcpy (&tun.local_crypto_key, &mp->local_crypto_key,
mp->local_crypto_key_len);
memcpy (&tun.remote_crypto_key, &mp->remote_crypto_key,