From fd2ebf0cf9354262a8d80320836ff586575bfde7 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 14 Nov 2008 13:12:07 +0000 Subject: fixed encap enabling in xfrm (using new encap state, not the old one) --- src/charon/plugins/kernel_netlink/kernel_netlink_ipsec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/charon/plugins/kernel_netlink/kernel_netlink_ipsec.c') diff --git a/src/charon/plugins/kernel_netlink/kernel_netlink_ipsec.c b/src/charon/plugins/kernel_netlink/kernel_netlink_ipsec.c index fbcd676e4..79b4882bc 100644 --- a/src/charon/plugins/kernel_netlink/kernel_netlink_ipsec.c +++ b/src/charon/plugins/kernel_netlink/kernel_netlink_ipsec.c @@ -1209,7 +1209,7 @@ static status_t update_sa(private_kernel_netlink_ipsec_t *this, u_int32_t spi, protocol_id_t protocol, u_int16_t cpi, host_t *src, host_t *dst, host_t *new_src, host_t *new_dst, - bool encap, bool new_encap) + bool old_encap, bool new_encap) { unsigned char request[NETLINK_BUFFER_SIZE], *pos; struct nlmsghdr *hdr, *out = NULL; @@ -1320,7 +1320,7 @@ static status_t update_sa(private_kernel_netlink_ipsec_t *this, while(RTA_OK(rta, rtasize)) { /* copy all attributes, but not XFRMA_ENCAP if we are disabling it */ - if (rta->rta_type != XFRMA_ENCAP || encap) + if (rta->rta_type != XFRMA_ENCAP || new_encap) { if (rta->rta_type == XFRMA_ENCAP) { /* update encap tmpl */ @@ -1336,7 +1336,7 @@ static status_t update_sa(private_kernel_netlink_ipsec_t *this, } rta = (struct rtattr*)pos; - if (tmpl == NULL && encap) + if (tmpl == NULL && new_encap) { /* add tmpl if we are enabling it */ rta->rta_type = XFRMA_ENCAP; rta->rta_len = RTA_LENGTH(sizeof(struct xfrm_encap_tmpl)); -- cgit v1.2.3