aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2007-01-03 09:25:57 +0000
committerMartin Willi <martin@strongswan.org>2007-01-03 09:25:57 +0000
commit60d79e496b98b16c6312f8e616ae23fda76eeeb7 (patch)
treecb428ea6e226cce972c337424eeec5f7a912d86a
parent6b50ddfa0da6047cff888a4cc16d4cc165a8353a (diff)
downloadstrongswan-60d79e496b98b16c6312f8e616ae23fda76eeeb7.tar.bz2
strongswan-60d79e496b98b16c6312f8e616ae23fda76eeeb7.tar.xz
fixed host conversion length check
-rw-r--r--src/charon/threads/kernel_interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/charon/threads/kernel_interface.c b/src/charon/threads/kernel_interface.c
index 074e7fcc8..3ec2bd58e 100644
--- a/src/charon/threads/kernel_interface.c
+++ b/src/charon/threads/kernel_interface.c
@@ -428,7 +428,7 @@ static void receive_messages(private_kernel_interface_t *this)
static void host2xfrm(host_t *host, xfrm_address_t *xfrm)
{
chunk_t chunk = host->get_address(host);
- memcpy(xfrm, chunk.ptr, max(chunk.len, sizeof(xfrm_address_t)));
+ memcpy(xfrm, chunk.ptr, min(chunk.len, sizeof(xfrm_address_t)));
}
/**
@@ -631,7 +631,7 @@ static status_t add_sa(private_kernel_interface_t *this,
rthdr = XFRM_RTA_NEXT(rthdr);
}
-
+
if (send_message(this, hdr, &response) != SUCCESS)
{
DBG1(DBG_KNL, "netlink communication failed");