From 53dd08c59eac0c2fe2f7c38ec242c57bfc3ea0ad Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 24 Jun 2021 15:41:03 +0000 Subject: ipsec: Derive the TUNNEL_V6 flag from the configured address types Type: improvement There's no need for the user to set the TUNNEL_V6 flag, it can be derived from the tunnel's address type. Signed-off-by: Neale Ranns Change-Id: I073073dc970b8a3f2b2645bc697fc00db1adbb47 --- src/vnet/ipsec/ipsec_sa.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vnet/ipsec/ipsec_sa.c') diff --git a/src/vnet/ipsec/ipsec_sa.c b/src/vnet/ipsec/ipsec_sa.c index b1e337470ab..b5d58d0c053 100644 --- a/src/vnet/ipsec/ipsec_sa.c +++ b/src/vnet/ipsec/ipsec_sa.c @@ -270,6 +270,10 @@ ipsec_sa_add_and_lock (u32 id, u32 spi, ipsec_protocol_t proto, return VNET_API_ERROR_SYSCALL_ERROR_1; } + if (ipsec_sa_is_set_IS_TUNNEL (sa) && + AF_IP6 == ip_addr_version (&tun->t_src)) + ipsec_sa_set_IS_TUNNEL_V6 (sa); + if (ipsec_sa_is_set_IS_TUNNEL (sa) && !ipsec_sa_is_set_IS_INBOUND (sa)) { sa->tunnel_flags = sa->tunnel.t_encap_decap_flags; -- cgit 1.2.3-korg