--- embedaddon/ipsec-tools/src/racoon/isakmp_cfg.c 2013/07/22 12:01:28 1.1.1.1.2.2 +++ embedaddon/ipsec-tools/src/racoon/isakmp_cfg.c 2016/11/02 10:45:57 1.1.1.2 @@ -1,4 +1,4 @@ -/* $NetBSD: isakmp_cfg.c,v 1.24 2010/09/21 13:14:17 vanhu Exp $ */ +/* $NetBSD: isakmp_cfg.c,v 1.24.4.1 2013/04/12 10:04:21 tteras Exp $ */ /* Id: isakmp_cfg.c,v 1.55 2006/08/22 18:17:17 manubsd Exp */ @@ -38,7 +38,9 @@ #include #include +#if __FreeBSD_version >= 900007 #include +#endif #if defined(__APPLE__) && defined(__MACH__) #include #endif @@ -1000,6 +1002,9 @@ isakmp_cfg_varlen(iph1, attr, string, len) struct isakmp_data *new; char *data; + if (!len) + return NULL; + if ((buffer = vmalloc(sizeof(*attr) + len)) == NULL) { plog(LLV_ERROR, LOCATION, NULL, "Cannot allocate memory\n"); return NULL; @@ -1660,6 +1665,7 @@ isakmp_cfg_accounting_system(port, raddr, usr, inout) char *usr; int inout; { +#if __FreeBSD_version >= 900007 int error = 0; struct utmpx ut; char addr[NI_MAXHOST]; @@ -1703,6 +1709,7 @@ isakmp_cfg_accounting_system(port, raddr, usr, inout) plog(LLV_ERROR, LOCATION, NULL, "Unepected inout\n"); break; } +#endif return 0; }