Use LONG_MAX instead of a hard-coded value.
authorTobias Brunner <tobias@strongswan.org>
Thu, 6 Aug 2009 16:22:01 +0000 (18:22 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 6 Aug 2009 16:22:01 +0000 (18:22 +0200)
src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c

index 7ccb96b..d1d2ecd 100644 (file)
 #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