diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-08-06 18:22:01 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-08-06 18:22:01 +0200 |
commit | 79ff6141449c95fe59b4c3905cc0cb89420860ff (patch) | |
tree | d37efc4d6fb779ee876a82017b9098a734036535 /src/charon/plugins/kernel_pfkey | |
parent | bfca7aa5ede1d8ec5a39dad976dc3fdd8b51db14 (diff) | |
download | strongswan-79ff6141449c95fe59b4c3905cc0cb89420860ff.tar.bz2 strongswan-79ff6141449c95fe59b4c3905cc0cb89420860ff.tar.xz |
Use LONG_MAX instead of a hard-coded value.
Diffstat (limited to 'src/charon/plugins/kernel_pfkey')
-rw-r--r-- | src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c b/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c index 7ccb96bed..d1d2ecd4d 100644 --- a/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c +++ b/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c @@ -17,6 +17,10 @@ #include <sys/types.h> #include <sys/socket.h> +#ifdef __FreeBSD__ +#include <limits.h> /* for LONG_MAX */ +#endif + #ifdef HAVE_NET_PFKEYV2_H #include <net/pfkeyv2.h> #else @@ -1719,7 +1723,7 @@ static status_t add_policy(private_kernel_pfkey_ipsec_t *this, lft = (struct sadb_lifetime*)PFKEY_EXT_ADD_NEXT(msg); lft->sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD; lft->sadb_lifetime_len = PFKEY_LEN(sizeof(struct sadb_lifetime)); - lft->sadb_lifetime_addtime = 0x7fffffff; /* kernel maps this to long */ + lft->sadb_lifetime_addtime = LONG_MAX; PFKEY_EXT_ADD(msg, lft); } #endif |