dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in,v 1.13.2.61 2003/05/06 21:13:13 guus Exp $
+dnl $Id: configure.in,v 1.13.2.62 2003/07/06 17:15:24 guus Exp $
AC_PREREQ(2.53)
AC_INIT(src/tincd.c)
AC_HEADER_TIME
AC_STRUCT_TM
-AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
-[
- AC_TRY_COMPILE(
+AC_CHECK_TYPES([socklen_t, struct addrinfo, struct sockaddr_in6], , ,
[#include <sys/types.h>
- #include <sys/socket.h>],
- [socklen_t len = 42; return len;],
- ac_cv_type_socklen_t=yes,
- ac_cv_type_socklen_t=no)
-])
-if test $ac_cv_type_socklen_t = yes; then
- AC_DEFINE(HAVE_SOCKLEN_T, 1, [socklen_t available])
-fi
-
-AC_CACHE_CHECK([for struct addrinfo], ac_cv_struct_addrinfo,
-[
- AC_TRY_COMPILE(
- [#include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>],
- [struct addrinfo ai; ai.ai_family = AF_INET; return ai.ai_family;],
- ac_cv_struct_addrinfo=yes,
- ac_cv_struct_addrinfo=no)
-])
-if test $ac_cv_struct_addrinfo = yes; then
- AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [struct addrinfo available])
-fi
+ #include <sys/socket.h>
+ #include <netdb.h>
+ #include <netinet/in.h>
+ ]
+)
dnl Checks for library functions.
AC_FUNC_MEMCMP
[AC_MSG_ERROR([OpenSSL libraries not found.])]
)
- AC_CHECK_FUNCS([RAND_pseudo_bytes OPENSSL_add_all_algorithms_noconf OpenSSL_add_all_algorithms SSLeay_add_all_algorithms])
+ AC_CHECK_FUNCS([RAND_pseudo_bytes EVP_EncryptInit_ex], ,
+ [AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
+ )
+
+ AC_CHECK_DECL([OpenSSL_add_all_algorithms], ,
+ [AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
+ [#include <openssl/evp.h>]
+ )
AC_CHECK_FUNC(dlopen,
[],
[AC_CHECK_LIB(dl, dlopen,
[LIBS="$LIBS -ldl"],
- [AC_MSG_ERROR([OpenSSL depends on libdl.])]
+ [AC_MSG_ERROR([OpenSSL depends on libdl.]); break]
)]
)
])
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.c,v 1.35.4.186 2003/05/06 21:13:14 guus Exp $
+ $Id: net.c,v 1.35.4.187 2003/07/06 17:15:25 guus Exp $
*/
#include "config.h"
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include "system.h"
-#ifndef HAVE_RAND_PSEUDO_BYTES
-#define RAND_pseudo_bytes RAND_bytes
-#endif
-
int do_purge = 0;
int sighup = 0;
int sigalrm = 0;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.h,v 1.9.4.58 2003/05/07 11:21:58 guus Exp $
+ $Id: net.h,v 1.9.4.59 2003/07/06 17:15:25 guus Exp $
*/
#ifndef __TINC_NET_H__
typedef union {
struct sockaddr sa;
struct sockaddr_in in;
+#ifdef HAVE_STRUCT_SOCKADDR_IN6
struct sockaddr_in6 in6;
+#endif
} sockaddr_t;
#ifdef SA_LEN
#define SALEN(s) SA_LEN(&s)
#else
+#ifdef HAVE_STRUCT_SOCKADDR_IN6
#define SALEN(s) (s.sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6))
+#else
+#define SALEN(s) (sizeof sockaddr_in)
+#endif
#endif
typedef struct vpn_packet_t {
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_auth.c,v 1.1.4.19 2003/01/17 00:37:20 guus Exp $
+ $Id: protocol_auth.c,v 1.1.4.20 2003/07/06 17:15:25 guus Exp $
*/
#include "config.h"
#include <openssl/rand.h>
#include <openssl/evp.h>
-#ifndef HAVE_RAND_PSEUDO_BYTES
-#define RAND_pseudo_bytes RAND_bytes
-#endif
-
#include "conf.h"
#include "net.h"
#include "netutl.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: route.c,v 1.1.2.51 2003/06/11 19:40:43 guus Exp $
+ $Id: route.c,v 1.1.2.52 2003/07/06 17:15:25 guus Exp $
*/
#include "config.h"
#include "system.h"
+/* Missing definitions */
+
#ifndef ETHER_ADDR_LEN
#define ETHER_ADDR_LEN 6
#endif
+#ifndef ICMP_DEST_UNREACH
+#define ICMP_DEST_UNREACH 3
+#endif
+
+#ifndef ICMP_NET_UNKNOWN
+#define ICMP_NET_UNKNOWN 6
+#endif
+
+#ifndef ICMP_NET_UNREACH
+#define ICMP_NET_UNREACH 0
+#endif
+
int routing_mode = RMODE_ROUTER;
int priorityinheritance = 0;
int macexpire = 600;
memcpy(&ip_dst, &hdr->ip_dst, 4);
oldlen = packet->len - 14;
- if(oldlen >= IP_MSS - sizeof(*hdr) - sizeof(struct icmphdr))
- oldlen = IP_MSS - sizeof(*hdr) - sizeof(struct icmphdr);
+ if(oldlen >= IP_MSS - sizeof(*hdr) - sizeof(*icmp))
+ oldlen = IP_MSS - sizeof(*hdr) - sizeof(*icmp);
/* Copy first part of original contents to ICMP message */
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: tincd.c,v 1.10.4.68 2003/06/11 19:07:56 guus Exp $
+ $Id: tincd.c,v 1.10.4.69 2003/07/06 17:15:25 guus Exp $
*/
#include "config.h"
RAND_load_file("/dev/urandom", 1024);
-#ifdef HAVE_OPENSSL_ADD_ALL_ALGORITHMS_NOCONF
- OPENSSL_add_all_algorithms_noconf();
-#else
-#ifdef HAVE_OPENSSL_ADD_ALL_ALGORITHMS
OpenSSL_add_all_algorithms();
-#else
-#ifdef HAVE_SSLEAY_ADD_ALL_ALGORITHMS
- SSLeay_add_all_algorithms();
-#else
-#error No add_all_algorithms function available!
-#endif
-#endif
-#endif
if(generate_keys) {
read_server_config();