Import Debian changes 1.0.15-1

tinc (1.0.15-1) unstable; urgency=low

  * New upstream release.
  * Send SIGALRM to running tinc daemons whenever an interface is brought up
    with the ifupdown framework. Based on a patch from Joachim Breitner.
    Closes: #629880
  * Allow tinc daemons to be started using ifupdown.
This commit is contained in:
Guus Sliepen 2011-06-24 18:21:51 +02:00
commit 2ad1dc3fd7
66 changed files with 887 additions and 496 deletions

View file

@ -11,6 +11,7 @@ Significant contributions from:
- Julien Muchembled <jm@jmuchemb.eu> - Julien Muchembled <jm@jmuchemb.eu>
- Timothy Redaelli <timothy@redaelli.eu> - Timothy Redaelli <timothy@redaelli.eu>
- Brandon Black <blblack@gmail.com> - Brandon Black <blblack@gmail.com>
- Loïc Grenié <loic.grenie@gmail.com>
These files are from other sources: These files are from other sources:
* lib/pidfile.h and lib/pidfile.c are by Martin Schulze, taken from * lib/pidfile.h and lib/pidfile.c are by Martin Schulze, taken from

View file

@ -1,6 +1,86 @@
commit f3f7ccfb2890576cb8992ec5e432310cec27627a commit 05260f941c2a24eb3f09070a2550cf15e431266a
Author: Guus Sliepen <guus@tinc-vpn.org> Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Sun May 8 23:15:25 2011 +0200 Date: Fri Jun 24 14:50:20 2011 +0200
Releasing 1.0.15.
commit 3c0511984f0041f79e64bcc55d58680f86e8e408
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Fri Jun 24 12:27:04 2011 +0200
Remove redundant @CFLAGS@ from AM_CFLAGS.
commit 4b3fd94b1cc79c24c4092b6b10ed4627a2648d26
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Mon Jun 6 16:26:11 2011 +0200
Improved --logfile option.
Instead of UNIX time, the log messages now start with the time in RFC3339
format, which human-readable and still easy for the computer to parse and sort.
The HUP signal will also cause the log file to be closed and reopened, which is
useful when log rotation is used. If there is an error while opening the log
file, this is logged to stderr.
commit b3bbeab6e669795f6f5a6b98590da359178bfdce
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Sat Jun 4 11:27:54 2011 +0200
Attribution for Loïc Grenié.
commit 50af33d01f425983dd2b1d7b61092a6325be3f41
Author: Loïc Grenié <loic.grenie@gmail.com>
Date: Sat Jun 4 09:05:23 2011 +0200
Nearly tickless tinc.
Use pselect instead of select in main_loop (if available). This lets
tincd sleeps as long as there is nothing to do.
commit 64771f73ebbff04262defcde59263e98f89f0fa1
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Sat May 28 23:46:56 2011 +0200
Remove a few unnecessary #includes.
Some spotted by Michael Tokarev.
commit 5cff8c47c1781a88123c128a4cec6cdd39925aa5
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Sat May 28 23:42:18 2011 +0200
Remove newlines from log messages.
commit 6d08eb1614b59d5f86a43edda9db06fca72b76cd
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Sat May 28 23:36:52 2011 +0200
Fix sparse warnings and add an extra sprinkling of const.
This is more or less the equivalent of Sven-Haegar Koch's fixes in the 1.1
branch.
commit 07ffb1a19859791d419b83a876ba552dadedbf46
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Sun May 22 15:56:04 2011 +0200
Make return value of SetPriorityClass() behave the same as setpriority().
commit 03b7118139f57033659730afb740bf5cef7c961c
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Fri May 13 12:37:26 2011 +0200
Reorder checks for libraries to allow ./configure LDFLAGS=-static.
OpenSSL depends on libdl and libz. When linking dynamically, libcrypto will
automatically link with the other two libraries. However, when linking
statically, these libraries need to be specified explicitly while linking. By
moving the autoconf checks for libdl and libz before those for libcrypto, we
ensure the latter test will be done with the proper libraries.
commit 5686ad80b545afa3de9ed2f4176a5346e289aaa8
Author: Guus Sliepen <guus@tinc-vpn.org>
Date: Sun May 8 23:17:46 2011 +0200
Releasing 1.0.14. Releasing 1.0.14.

View file

@ -37,7 +37,7 @@ subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
THANKS TODO config.guess config.sub depcomp install-sh missing THANKS config.guess config.sub depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
$(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \ $(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \

8
NEWS
View file

@ -1,3 +1,11 @@
Version 1.0.15 June 24 2011
* Improved logging to file.
* Reduced amount of process wakeups on platforms which support pselect().
* Fixed ProcessPriority option under Windows.
Version 1.0.14 May 8 2011 Version 1.0.14 May 8 2011
* Fixed reading configuration files that do not end with a newline. Again. * Fixed reading configuration files that do not end with a newline. Again.

4
README
View file

@ -1,4 +1,4 @@
This is the README file for tinc version 1.0.14. Installation This is the README file for tinc version 1.0.15. Installation
instructions may be found in the INSTALL file. instructions may be found in the INSTALL file.
tinc is Copyright (C) 1998-2011 by: tinc is Copyright (C) 1998-2011 by:
@ -55,7 +55,7 @@ should be changed into "Device", and "Device" should be changed into
Compatibility Compatibility
------------- -------------
Version 1.0.14 is compatible with 1.0pre8, 1.0 and later, but not with older Version 1.0.15 is compatible with 1.0pre8, 1.0 and later, but not with older
versions of tinc. versions of tinc.

1
THANKS
View file

@ -19,6 +19,7 @@ We would like to thank the following people for their contributions to tinc:
* Jeroen Ubbink * Jeroen Ubbink
* Jerome Etienne * Jerome Etienne
* Julien Muchembled * Julien Muchembled
* Loïc Grenié
* Lubomír Bulej * Lubomír Bulej
* Mads Kiilerich * Mads Kiilerich
* Marc A. Lehmann * Marc A. Lehmann

7
TODO
View file

@ -1,7 +0,0 @@
* end-to-end encryption
* perfect forward secrecy, ECDH
* AES in counter mode
* Replay + Delay protection
* MPLS-like label
* Conflicting Subnets or key-name pairs: disable both, inform admin

219
config.guess vendored
View file

@ -1,10 +1,10 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# Free Software Foundation, Inc. # 2011 Free Software Foundation, Inc.
timestamp='2009-12-30' timestamp='2011-05-11'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -57,7 +57,7 @@ GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
Software Foundation, Inc. Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
@ -181,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi fi
;; ;;
*) *)
os=netbsd os=netbsd
;; ;;
esac esac
# The OS release # The OS release
@ -224,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;; ;;
*5.*) *5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;; ;;
esac esac
# According to Compaq, /usr/sbin/psrinfo has been available on # According to Compaq, /usr/sbin/psrinfo has been available on
@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;; # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*) Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead # Should we change UNAME_MACHINE based on the output of uname instead
@ -296,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe echo s390-ibm-zvmoe
exit ;; exit ;;
*:OS400:*:*) *:OS400:*:*)
echo powerpc-ibm-os400 echo powerpc-ibm-os400
exit ;; exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE} echo arm-acorn-riscix${UNAME_RELEASE}
@ -395,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should # MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem. # be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit ;; exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit ;; exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit ;; exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE} echo m68k-milan-mint${UNAME_RELEASE}
exit ;; exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE} echo m68k-hades-mint${UNAME_RELEASE}
exit ;; exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE} echo m68k-unknown-mint${UNAME_RELEASE}
exit ;; exit ;;
m68k:machten:*:*) m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE} echo m68k-apple-machten${UNAME_RELEASE}
exit ;; exit ;;
@ -481,8 +484,8 @@ EOF
echo m88k-motorola-sysv3 echo m88k-motorola-sysv3
exit ;; exit ;;
AViiON:dgux:*:*) AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures # DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@ -495,7 +498,7 @@ EOF
else else
echo i586-dg-dgux${UNAME_RELEASE} echo i586-dg-dgux${UNAME_RELEASE}
fi fi
exit ;; exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3) M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3 echo m88k-dolphin-sysv3
exit ;; exit ;;
@ -552,7 +555,7 @@ EOF
echo rs6000-ibm-aix3.2 echo rs6000-ibm-aix3.2
fi fi
exit ;; exit ;;
*:AIX:*:[456]) *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000 IBM_ARCH=rs6000
@ -595,52 +598,52 @@ EOF
9000/[678][0-9][0-9]) 9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0 532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;; 32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;; 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;; esac ;;
esac esac
fi fi
if [ "${HP_ARCH}" = "" ]; then if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE #define _HPUX_SOURCE
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
int main () int main ()
{ {
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS); long bits = sysconf(_SC_KERNEL_BITS);
#endif #endif
long cpu = sysconf (_SC_CPU_VERSION); long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu) switch (cpu)
{ {
case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0: case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
switch (bits) switch (bits)
{ {
case 64: puts ("hppa2.0w"); break; case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break; case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break; default: puts ("hppa2.0"); break;
} break; } break;
#else /* !defined(_SC_KERNEL_BITS) */ #else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break; puts ("hppa2.0"); break;
#endif #endif
default: puts ("hppa1.0"); break; default: puts ("hppa1.0"); break;
} }
exit (0); exit (0);
} }
EOF EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa test -z "$HP_ARCH" && HP_ARCH=hppa
@ -731,22 +734,22 @@ EOF
exit ;; exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd echo c1-convex-bsd
exit ;; exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc if getsysinfo -f scalar_acc
then echo c32-convex-bsd then echo c32-convex-bsd
else echo c2-convex-bsd else echo c2-convex-bsd
fi fi
exit ;; exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd echo c34-convex-bsd
exit ;; exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd echo c38-convex-bsd
exit ;; exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd echo c4-convex-bsd
exit ;; exit ;;
CRAY*Y-MP:*:*:*) CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;; exit ;;
@ -770,14 +773,14 @@ EOF
exit ;; exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
5000:UNIX_System_V:4.*:*) 5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@ -805,14 +808,14 @@ EOF
echo ${UNAME_MACHINE}-pc-mingw32 echo ${UNAME_MACHINE}-pc-mingw32
exit ;; exit ;;
i*:windows32*:*) i*:windows32*:*)
# uname -m includes "-pc" on this system. # uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32 echo ${UNAME_MACHINE}-mingw32
exit ;; exit ;;
i*:PW*:*) i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32 echo ${UNAME_MACHINE}-pc-pw32
exit ;; exit ;;
*:Interix*:*) *:Interix*:*)
case ${UNAME_MACHINE} in case ${UNAME_MACHINE} in
x86) x86)
echo i586-pc-interix${UNAME_RELEASE} echo i586-pc-interix${UNAME_RELEASE}
exit ;; exit ;;
@ -867,7 +870,7 @@ EOF
EV6) UNAME_MACHINE=alphaev6 ;; EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;; EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;; EV68*) UNAME_MACHINE=alphaev68 ;;
esac esac
objdump --private-headers /bin/sh | grep -q ld.so.1 objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
@ -879,7 +882,13 @@ EOF
then then
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
else else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi fi
exit ;; exit ;;
avr32*:Linux:*:*) avr32*:Linux:*:*)
@ -892,7 +901,7 @@ EOF
echo crisv32-axis-linux-gnu echo crisv32-axis-linux-gnu
exit ;; exit ;;
frv:Linux:*:*) frv:Linux:*:*)
echo frv-unknown-linux-gnu echo frv-unknown-linux-gnu
exit ;; exit ;;
i*86:Linux:*:*) i*86:Linux:*:*)
LIBC=gnu LIBC=gnu
@ -960,7 +969,7 @@ EOF
echo ${UNAME_MACHINE}-ibm-linux echo ${UNAME_MACHINE}-ibm-linux
exit ;; exit ;;
sh64*:Linux:*:*) sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
sh*:Linux:*:*) sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
@ -968,6 +977,9 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*) sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-tilera-linux-gnu
exit ;;
vax:Linux:*:*) vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;; exit ;;
@ -975,7 +987,7 @@ EOF
echo x86_64-unknown-linux-gnu echo x86_64-unknown-linux-gnu
exit ;; exit ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
i*86:DYNIX/ptx:4*:*) i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@ -984,11 +996,11 @@ EOF
echo i386-sequent-sysv4 echo i386-sequent-sysv4
exit ;; exit ;;
i*86:UNIX_SV:4.2MP:2.*) i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version # Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2... # number series starting with 2...
# I am not positive that other SVR4 systems won't match this, # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms. # I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it. # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;; exit ;;
i*86:OS/2:*:*) i*86:OS/2:*:*)
@ -1020,7 +1032,7 @@ EOF
fi fi
exit ;; exit ;;
i*86:*:5:[678]*) i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6. # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;; *486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;; *Pentium) UNAME_MACHINE=i586 ;;
@ -1048,13 +1060,13 @@ EOF
exit ;; exit ;;
pc:*:*:*) pc:*:*:*)
# Left here for compatibility: # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586. # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub # Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that # prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build. # this is a cross-build.
echo i586-pc-msdosdjgpp echo i586-pc-msdosdjgpp
exit ;; exit ;;
Intel:Mach:3*:*) Intel:Mach:3*:*)
echo i386-pc-mach3 echo i386-pc-mach3
exit ;; exit ;;
@ -1089,8 +1101,8 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;; && { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*) NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3' OS_REL='.3'
test -r /etc/.relid \ test -r /etc/.relid \
@ -1133,10 +1145,10 @@ EOF
echo ns32k-sni-sysv echo ns32k-sni-sysv
fi fi
exit ;; exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV> # says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4 echo i586-unisys-sysv4
exit ;; exit ;;
*:UNIX_System_V:4*:FTX*) *:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>. # From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm # How about differentiating between stratus architectures? -djm
@ -1162,11 +1174,11 @@ EOF
exit ;; exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE} echo mips-nec-sysv${UNAME_RELEASE}
else else
echo mips-unknown-sysv${UNAME_RELEASE} echo mips-unknown-sysv${UNAME_RELEASE}
fi fi
exit ;; exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos echo powerpc-be-beos
exit ;; exit ;;
@ -1231,6 +1243,9 @@ EOF
*:QNX:*:4*) *:QNX:*:4*)
echo i386-pc-qnx echo i386-pc-qnx
exit ;; exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-?:NONSTOP_KERNEL:*:*) NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE} echo nse-tandem-nsk${UNAME_RELEASE}
exit ;; exit ;;
@ -1276,13 +1291,13 @@ EOF
echo pdp10-unknown-its echo pdp10-unknown-its
exit ;; exit ;;
SEI:*:*:SEIUX) SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE} echo mips-sei-seiux${UNAME_RELEASE}
exit ;; exit ;;
*:DragonFly:*:*) *:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;; exit ;;
*:*VMS:*:*) *:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null` UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;; A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;;
@ -1322,11 +1337,11 @@ main ()
#include <sys/param.h> #include <sys/param.h>
printf ("m68k-sony-newsos%s\n", printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4 #ifdef NEWSOS4
"4" "4"
#else #else
"" ""
#endif #endif
); exit (0); ); exit (0);
#endif #endif
#endif #endif

View file

@ -206,6 +206,9 @@
/* Define to 1 if you have the <openssl/sha.h> header file. */ /* Define to 1 if you have the <openssl/sha.h> header file. */
#undef HAVE_OPENSSL_SHA_H #undef HAVE_OPENSSL_SHA_H
/* Define to 1 if you have the `pselect' function. */
#undef HAVE_PSELECT
/* Define to 1 if you have the `putenv' function. */ /* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV #undef HAVE_PUTENV
@ -333,6 +336,9 @@
/* Define to 1 if you have the <sys/wait.h> header file. */ /* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H #undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H

156
config.sub vendored
View file

@ -1,10 +1,10 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# Free Software Foundation, Inc. # 2011 Free Software Foundation, Inc.
timestamp='2010-01-22' timestamp='2011-03-23'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
@ -76,7 +76,7 @@ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
Software Foundation, Inc. Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
@ -124,8 +124,9 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*) storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
@ -157,8 +158,8 @@ case $os in
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
-bluegene*) -bluegene*)
os=-cnk os=-cnk
;; ;;
-sim | -cisco | -oki | -wec | -winbond) -sim | -cisco | -oki | -wec | -winbond)
os= os=
@ -174,10 +175,10 @@ case $os in
os=-chorusos os=-chorusos
basic_machine=$1 basic_machine=$1
;; ;;
-chorusrdb) -chorusrdb)
os=-chorusrdb os=-chorusrdb
basic_machine=$1 basic_machine=$1
;; ;;
-hiux*) -hiux*)
os=-hiuxwe2 os=-hiuxwe2
;; ;;
@ -282,11 +283,13 @@ case $basic_machine in
| moxie \ | moxie \
| mt \ | mt \
| msp430 \ | msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 \ | nios | nios2 \
| ns16k | ns32k \ | ns16k | ns32k \
| open8 \
| or32 \ | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \ | pyramid \
| rx \ | rx \
| score \ | score \
@ -294,15 +297,24 @@ case $basic_machine in
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \ | spu \
| tahoe | thumb | tic4x | tic80 | tron \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \ | ubicom32 \
| v850 | v850e \ | v850 | v850e \
| we32k \ | we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80) | z8k | z80)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | picochip) m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12. # Motorola 68HC11/12.
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
@ -314,6 +326,18 @@ case $basic_machine in
basic_machine=mt-unknown basic_machine=mt-unknown
;; ;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users. # (2) the word "unknown" tends to confuse beginning users.
@ -334,7 +358,7 @@ case $basic_machine in
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \ | avr-* | avr32-* \
| bfin-* | bs2000-* \ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \ | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \ | d10v-* | d30v-* | dlx-* \
| elxsi-* \ | elxsi-* \
@ -368,26 +392,28 @@ case $basic_machine in
| mmix-* \ | mmix-* \
| mt-* \ | mt-* \
| msp430-* \ | msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \ | nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \ | pyramid-* \
| romp-* | rs6000-* | rx-* \ | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \ | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile-* | tilegx-* \ | tile-* | tilegx-* \
| tron-* \ | tron-* \
| ubicom32-* \ | ubicom32-* \
| v850-* | v850e-* | vax-* \ | v850-* | v850e-* | vax-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \ | xstormy16-* | xtensa*-* \
| ymp-* \ | ymp-* \
| z8k-* | z80-*) | z8k-* | z80-*)
@ -412,7 +438,7 @@ case $basic_machine in
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
;; ;;
abacus) abacus)
basic_machine=abacus-unknown basic_machine=abacus-unknown
;; ;;
adobe68k) adobe68k)
@ -482,11 +508,20 @@ case $basic_machine in
basic_machine=powerpc-ibm basic_machine=powerpc-ibm
os=-cnk os=-cnk
;; ;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90) c90)
basic_machine=c90-cray basic_machine=c90-cray
os=-unicos os=-unicos
;; ;;
cegcc) cegcc)
basic_machine=arm-unknown basic_machine=arm-unknown
os=-cegcc os=-cegcc
;; ;;
@ -518,7 +553,7 @@ case $basic_machine in
basic_machine=craynv-cray basic_machine=craynv-cray
os=-unicosmp os=-unicosmp
;; ;;
cr16) cr16 | cr16-*)
basic_machine=cr16-unknown basic_machine=cr16-unknown
os=-elf os=-elf
;; ;;
@ -734,7 +769,7 @@ case $basic_machine in
basic_machine=ns32k-utek basic_machine=ns32k-utek
os=-sysv os=-sysv
;; ;;
microblaze) microblaze)
basic_machine=microblaze-xilinx basic_machine=microblaze-xilinx
;; ;;
mingw32) mingw32)
@ -841,6 +876,12 @@ case $basic_machine in
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem) nsr-tandem)
basic_machine=nsr-tandem basic_machine=nsr-tandem
;; ;;
@ -923,9 +964,10 @@ case $basic_machine in
;; ;;
power) basic_machine=power-ibm power) basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc | ppcbe) basic_machine=powerpc-unknown
;; ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
@ -1019,6 +1061,9 @@ case $basic_machine in
basic_machine=i860-stratus basic_machine=i860-stratus
os=-sysv4 os=-sysv4
;; ;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2) sun2)
basic_machine=m68000-sun basic_machine=m68000-sun
;; ;;
@ -1075,20 +1120,8 @@ case $basic_machine in
basic_machine=t90-cray basic_machine=t90-cray
os=-unicos os=-unicos
;; ;;
tic54x | c54x*) # This must be matched before tile*.
basic_machine=tic54x-unknown tilegx*)
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
# This must be matched before tile*.
tilegx*)
basic_machine=tilegx-unknown basic_machine=tilegx-unknown
os=-linux-gnu os=-linux-gnu
;; ;;
@ -1163,6 +1196,9 @@ case $basic_machine in
xps | xps100) xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp) ymp)
basic_machine=ymp-cray basic_machine=ymp-cray
os=-unicos os=-unicos
@ -1260,11 +1296,11 @@ esac
if [ x"$os" != x"" ] if [ x"$os" != x"" ]
then then
case $os in case $os in
# First match some system type aliases # First match some system type aliases
# that might get confused with valid system types. # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception. # -solaris* is a basic system type, with this one exception.
-auroraux) -auroraux)
os=-auroraux os=-auroraux
;; ;;
-solaris1 | -solaris1.*) -solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'` os=`echo $os | sed -e 's|solaris1|sunos4|'`
@ -1301,7 +1337,8 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \ | -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \ | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@ -1348,7 +1385,7 @@ case $os in
-opened*) -opened*)
os=-openedition os=-openedition
;; ;;
-os400*) -os400*)
os=-os400 os=-os400
;; ;;
-wince*) -wince*)
@ -1397,7 +1434,7 @@ case $os in
-sinix*) -sinix*)
os=-sysv4 os=-sysv4
;; ;;
-tpf*) -tpf*)
os=-tpf os=-tpf
;; ;;
-triton*) -triton*)
@ -1442,8 +1479,8 @@ case $os in
-dicos*) -dicos*)
os=-dicos os=-dicos
;; ;;
-nacl*) -nacl*)
;; ;;
-none) -none)
;; ;;
*) *)
@ -1466,10 +1503,10 @@ else
# system, and we'll never get to this point. # system, and we'll never get to this point.
case $basic_machine in case $basic_machine in
score-*) score-*)
os=-elf os=-elf
;; ;;
spu-*) spu-*)
os=-elf os=-elf
;; ;;
*-acorn) *-acorn)
@ -1481,8 +1518,17 @@ case $basic_machine in
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
c4x-* | tic4x-*) c4x-* | tic4x-*)
os=-coff os=-coff
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;; ;;
# This must come before the *-dec entry. # This must come before the *-dec entry.
pdp10-*) pdp10-*)
@ -1509,7 +1555,7 @@ case $basic_machine in
m68*-cisco) m68*-cisco)
os=-aout os=-aout
;; ;;
mep-*) mep-*)
os=-elf os=-elf
;; ;;
mips*-cisco) mips*-cisco)
@ -1536,7 +1582,7 @@ case $basic_machine in
*-ibm) *-ibm)
os=-aix os=-aix
;; ;;
*-knuth) *-knuth)
os=-mmixware os=-mmixware
;; ;;
*-wec) *-wec)

366
configure vendored
View file

@ -707,9 +707,6 @@ enable_maintainer_mode
enable_dependency_tracking enable_dependency_tracking
enable_tunemu enable_tunemu
with_windows2000 with_windows2000
with_openssl
with_openssl_include
with_openssl_lib
enable_zlib enable_zlib
with_zlib with_zlib
with_zlib_include with_zlib_include
@ -718,6 +715,9 @@ enable_lzo
with_lzo with_lzo
with_lzo_include with_lzo_include
with_lzo_lib with_lzo_lib
with_openssl
with_openssl_include
with_openssl_lib
enable_jumbograms enable_jumbograms
' '
ac_precious_vars='build_alias ac_precious_vars='build_alias
@ -1362,17 +1362,17 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-windows2000 compile with support for Windows 2000. This disables --with-windows2000 compile with support for Windows 2000. This disables
support for tunneling over existing IPv6 networks. support for tunneling over existing IPv6 networks.
--with-openssl=DIR OpenSSL base directory, or:
--with-openssl-include=DIR
OpenSSL headers directory (without trailing
/openssl)
--with-openssl-lib=DIR OpenSSL library directory
--with-zlib=DIR zlib base directory, or: --with-zlib=DIR zlib base directory, or:
--with-zlib-include=DIR zlib headers directory --with-zlib-include=DIR zlib headers directory
--with-zlib-lib=DIR zlib library directory --with-zlib-lib=DIR zlib library directory
--with-lzo=DIR lzo base directory, or: --with-lzo=DIR lzo base directory, or:
--with-lzo-include=DIR lzo headers directory --with-lzo-include=DIR lzo headers directory
--with-lzo-lib=DIR lzo library directory --with-lzo-lib=DIR lzo library directory
--with-openssl=DIR OpenSSL base directory, or:
--with-openssl-include=DIR
OpenSSL headers directory (without trailing
/openssl)
--with-openssl-lib=DIR OpenSSL library directory
Some influential environment variables: Some influential environment variables:
CC C compiler command CC C compiler command
@ -2731,7 +2731,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE=tinc PACKAGE=tinc
VERSION=1.0.14 VERSION=1.0.15
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -5041,7 +5041,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi fi
for ac_header in stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h for ac_header in stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h
do : do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@ -5782,7 +5782,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
for ac_func in asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv usleep vsyslog writev for ac_func in asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall pselect putenv random select strdup strerror strsignal strtol system unsetenv usleep vsyslog writev
do : do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@ -6175,178 +6175,6 @@ rm -f confcache
# Check whether --with-openssl was given.
if test "${with_openssl+set}" = set; then :
withval=$with_openssl; openssl="$withval"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
# Check whether --with-openssl-include was given.
if test "${with_openssl_include+set}" = set; then :
withval=$with_openssl_include; openssl_include="$withval"
CPPFLAGS="$CPPFLAGS -I$withval"
fi
# Check whether --with-openssl-lib was given.
if test "${with_openssl_lib+set}" = set; then :
withval=$with_openssl_lib; openssl_lib="$withval"
LDFLAGS="$LDFLAGS -L$withval"
fi
for ac_header in openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h openssl/engine.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
else
as_fn_error $? "OpenSSL header files not found." "$LINENO" 5; break
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_EncryptInit_ex in -lcrypto" >&5
$as_echo_n "checking for EVP_EncryptInit_ex in -lcrypto... " >&6; }
if ${ac_cv_lib_crypto_EVP_EncryptInit_ex+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char EVP_EncryptInit_ex ();
int
main ()
{
return EVP_EncryptInit_ex ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_crypto_EVP_EncryptInit_ex=yes
else
ac_cv_lib_crypto_EVP_EncryptInit_ex=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_EncryptInit_ex" >&5
$as_echo "$ac_cv_lib_crypto_EVP_EncryptInit_ex" >&6; }
if test "x$ac_cv_lib_crypto_EVP_EncryptInit_ex" = xyes; then :
LIBS="-lcrypto $LIBS"
else
as_fn_error $? "OpenSSL libraries not found." "$LINENO" 5
fi
case $host_os in
*mingw*)
;;
*)
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes; then :
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
ac_cv_lib_dl_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
LIBS="$LIBS -ldl"
else
as_fn_error $? "OpenSSL depends on libdl." "$LINENO" 5; break
fi
fi
;;
esac
for ac_func in RAND_pseudo_bytes EVP_EncryptInit_ex
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
else
as_fn_error $? "Missing OpenSSL functionality, make sure you have installed the latest version." "$LINENO" 5; break
fi
done
ac_fn_c_check_decl "$LINENO" "OpenSSL_add_all_algorithms" "ac_cv_have_decl_OpenSSL_add_all_algorithms" "#include <openssl/evp.h>
"
if test "x$ac_cv_have_decl_OpenSSL_add_all_algorithms" = xyes; then :
else
as_fn_error $? "Missing OpenSSL functionality, make sure you have installed the latest version." "$LINENO" 5; break
fi
# Check whether --enable-zlib was given. # Check whether --enable-zlib was given.
if test "${enable_zlib+set}" = set; then : if test "${enable_zlib+set}" = set; then :
enableval=$enable_zlib; enableval=$enable_zlib;
@ -6625,6 +6453,178 @@ done
fi fi
case $host_os in
*mingw*)
;;
*)
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes; then :
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
ac_cv_lib_dl_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
LIBS="$LIBS -ldl"
else
as_fn_error $? "OpenSSL depends on libdl." "$LINENO" 5; break
fi
fi
;;
esac
# Check whether --with-openssl was given.
if test "${with_openssl+set}" = set; then :
withval=$with_openssl; openssl="$withval"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
# Check whether --with-openssl-include was given.
if test "${with_openssl_include+set}" = set; then :
withval=$with_openssl_include; openssl_include="$withval"
CPPFLAGS="$CPPFLAGS -I$withval"
fi
# Check whether --with-openssl-lib was given.
if test "${with_openssl_lib+set}" = set; then :
withval=$with_openssl_lib; openssl_lib="$withval"
LDFLAGS="$LDFLAGS -L$withval"
fi
for ac_header in openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h openssl/engine.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
else
as_fn_error $? "OpenSSL header files not found." "$LINENO" 5; break
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_EncryptInit_ex in -lcrypto" >&5
$as_echo_n "checking for EVP_EncryptInit_ex in -lcrypto... " >&6; }
if ${ac_cv_lib_crypto_EVP_EncryptInit_ex+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char EVP_EncryptInit_ex ();
int
main ()
{
return EVP_EncryptInit_ex ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_crypto_EVP_EncryptInit_ex=yes
else
ac_cv_lib_crypto_EVP_EncryptInit_ex=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_EncryptInit_ex" >&5
$as_echo "$ac_cv_lib_crypto_EVP_EncryptInit_ex" >&6; }
if test "x$ac_cv_lib_crypto_EVP_EncryptInit_ex" = xyes; then :
LIBS="-lcrypto $LIBS"
else
as_fn_error $? "OpenSSL libraries not found." "$LINENO" 5
fi
for ac_func in RAND_pseudo_bytes EVP_EncryptInit_ex
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
else
as_fn_error $? "Missing OpenSSL functionality, make sure you have installed the latest version." "$LINENO" 5; break
fi
done
ac_fn_c_check_decl "$LINENO" "OpenSSL_add_all_algorithms" "ac_cv_have_decl_OpenSSL_add_all_algorithms" "#include <openssl/evp.h>
"
if test "x$ac_cv_have_decl_OpenSSL_add_all_algorithms" = xyes; then :
else
as_fn_error $? "Missing OpenSSL functionality, make sure you have installed the latest version." "$LINENO" 5; break
fi
# Check whether --enable-jumbograms was given. # Check whether --enable-jumbograms was given.
if test "${enable_jumbograms+set}" = set; then : if test "${enable_jumbograms+set}" = set; then :
enableval=$enable_jumbograms; enableval=$enable_jumbograms;

View file

@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61) AC_PREREQ(2.61)
AC_INIT AC_INIT
AC_CONFIG_SRCDIR([src/tincd.c]) AC_CONFIG_SRCDIR([src/tincd.c])
AM_INIT_AUTOMAKE(tinc, 1.0.14) AM_INIT_AUTOMAKE(tinc, 1.0.15)
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
@ -101,7 +101,7 @@ dnl Checks for header files.
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies. dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h]) AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h])
AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h], AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h],
[], [], [#include "have.h"] [], [], [#include "have.h"]
) )
@ -130,7 +130,7 @@ dnl Checks for library functions.
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv usleep vsyslog writev], AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall pselect putenv random select strdup strerror strsignal strtol system unsetenv usleep vsyslog writev],
[], [], [#include "have.h"] [], [], [#include "have.h"]
) )
AC_FUNC_MALLOC AC_FUNC_MALLOC
@ -153,9 +153,9 @@ AC_CACHE_SAVE
dnl These are defined in files in m4/ dnl These are defined in files in m4/
tinc_OPENSSL
tinc_ZLIB tinc_ZLIB
tinc_LZO tinc_LZO
tinc_OPENSSL
dnl Check if support for jumbograms is requested dnl Check if support for jumbograms is requested
AC_ARG_ENABLE(jumbograms, AC_ARG_ENABLE(jumbograms,

33
debian/README.Debian vendored
View file

@ -7,4 +7,35 @@ to read it.
The system startup script for tinc, /etc/init.d/tinc, uses the file The system startup script for tinc, /etc/init.d/tinc, uses the file
/etc/tinc/nets.boot to find out which networks have to be started. /etc/tinc/nets.boot to find out which networks have to be started.
-- Ivo Timmermans <ivo@debian.org>, Wed, 31 May 2000, 19:56:05 +0200 Alternatively, you can create a stanza in /etc/network/interfaces, and add a
line with "tinc-net <netname>". This will cause a tincd to be started which
uses the configuration from /etc/tinc/<netname>. You can use an inet static
(with address and netmask options) or inet dhcp stanza, in which case the ifup
will configure the VPN interface and you do not need to have a tinc-up script.
The following options are also recognized and map directly to the corresponding
command line options for tincd:
tinc-config <directory>
tinc-debug <level>
tinc-mlock yes
tinc-logfile <filename>
tinc-chroot yes
tinc-user <username>
An example stanza:
iface vpn inet static
address 192.168.2.42
netmask 255.255.0.0
tinc-net myvpn
tinc-debug 1
tinc-mlock yes
tinc-user nobody
This will start a tinc daemon that reads its configuration from
/etc/tinc/myvpn, logs at debug level 1, locks itself in RAM, runs as user
nobody, and creates a network interface called "vpn". Ifup then sets the
address and netmask on that interface.
-- Guus Sliepen <guus@debian.org>, Fri, 24 June 2011, 18:10:53 +0200

10
debian/changelog vendored
View file

@ -1,3 +1,13 @@
tinc (1.0.15-1) unstable; urgency=low
* New upstream release.
* Send SIGALRM to running tinc daemons whenever an interface is brought up
with the ifupdown framework. Based on a patch from Joachim Breitner.
Closes: #629880
* Allow tinc daemons to be started using ifupdown.
-- Guus Sliepen <guus@debian.org> Fri, 24 Jun 2011 18:21:51 +0200
tinc (1.0.14-1) unstable; urgency=low tinc (1.0.14-1) unstable; urgency=low
* New upstream release. * New upstream release.

19
debian/tinc.if-post-down vendored Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
set -e
if [ "$IF_TINC_NET" ] ; then
tincd -n "$IF_TINC_NET" -k
sleep 0.1
i=0;
while [ -f "/var/run/tinc.$IF_TINC_NET.pid" ] ; do
if [ $i = '30' ] ; then
echo 'Failed to stop tinc daemon!'
exit 1
fi
sleep 0.1
i=$(($i+1))
done
fi
exit 0

37
debian/tinc.if-pre-up vendored Executable file
View file

@ -0,0 +1,37 @@
#!/bin/sh
set -e
[ -z "$IF_TINC_NET" ] && exit 0
# Read options from /etc/default
. /etc/default/tinc
# Read options from /etc/network/interfaces
[ -n "$IF_TINC_CONFIG" ] && EXTRA="$EXTRA -c $IF_TINC_CONFIG"
[ -n "$IF_TINC_DEBUG" ] && EXTRA="$EXTRA -d$IF_TINC_DEBUG"
[ -n "$IF_TINC_MLOCK" ] && EXTRA="$EXTRA --mlock"
[ -n "$IF_TINC_LOGFILE" ] && EXTRA="$EXTRA --logfile=$IF_TINC_LOGFILE"
[ -n "$IF_TINC_CHROOT" ] && EXTRA="$EXTRA --chroot"
[ -n "$IF_TINC_USER" ] && EXTRA="$EXTRA --user=$IF_TINC_USER"
# Start tinc daemon
/usr/sbin/tincd -n "$IF_TINC_NET" -o "Interface=$IFACE" $EXTRA
# Wait for it to come up properly
sleep 0.1
i=0;
while [ ! -f "/var/run/tinc.$IF_TINC_NET.pid" ] ; do
if [ $i = '30' ] ; then
echo 'Failed to start tinc daemon!'
exit 1
fi
sleep 0.1
i=$(($i+1))
done
exit 0

8
debian/tinc.if-up vendored Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -e
[ "$METHOD" = loopback ] && exit 0
[ -n "$IF_TINC_NET" ] && exit 0
invoke-rc.d tinc alarm

View file

@ -44,6 +44,16 @@ foreach_net() {
echo "." echo "."
} }
signal_running() {
for i in /var/run/tinc.*pid; do
if [ -f "$i" ]; then
head -1 $i | while read pid; do
kill -$1 $pid
done
fi
done
}
start() { start() {
$DAEMON $EXTRA -n "$@" $DAEMON $EXTRA -n "$@"
} }
@ -53,6 +63,9 @@ stop() {
reload() { reload() {
$DAEMON -n $1 -kHUP $DAEMON -n $1 -kHUP
} }
alarm() {
$DAEMON -n $1 -kALRM
}
restart() { restart() {
stop "$@" stop "$@"
sleep 0.5 sleep 0.5
@ -82,6 +95,9 @@ case "$1" in
restart) restart)
foreach_net "Restarting $DESC:" restart foreach_net "Restarting $DESC:" restart
;; ;;
alarm)
signal_running ALRM
;;
*) *)
echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}" echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}"
exit 1 exit 1

Binary file not shown.

View file

@ -5,7 +5,7 @@ START-INFO-DIR-ENTRY
* tinc: (tinc). The tinc Manual. * tinc: (tinc). The tinc Manual.
END-INFO-DIR-ENTRY END-INFO-DIR-ENTRY
This is the info manual for tinc version 1.0.14, a Virtual Private This is the info manual for tinc version 1.0.15, a Virtual Private
Network daemon. Network daemon.
Copyright (C) 1998-2011 Ivo Timmermans, Guus Sliepen Copyright (C) 1998-2011 Ivo Timmermans, Guus Sliepen
@ -1503,7 +1503,9 @@ You can also send the following signals to a running tincd process:
`HUP' `HUP'
Partially rereads configuration files. Connections to hosts whose Partially rereads configuration files. Connections to hosts whose
host config file are removed are closed. New outgoing connections host config file are removed are closed. New outgoing connections
specified in `tinc.conf' will be made. specified in `tinc.conf' will be made. If the -logfile option is
used, this will also close and reopen the log file, useful when
log rotation is used.
`INT' `INT'
Temporarily increases debug level to 5. Send this signal again to Temporarily increases debug level to 5. Send this signal again to
@ -2509,25 +2511,25 @@ Node: Example configuration47500
Node: Running tinc52823 Node: Running tinc52823
Node: Runtime options53413 Node: Runtime options53413
Node: Signals56369 Node: Signals56369
Node: Debug levels57438 Node: Debug levels57561
Node: Solving problems58374 Node: Solving problems58497
Node: Error messages59926 Node: Error messages60049
Node: Sending bug reports63939 Node: Sending bug reports64062
Node: Technical information64891 Node: Technical information65014
Node: The connection65122 Node: The connection65245
Node: The UDP tunnel65434 Node: The UDP tunnel65557
Node: The meta-connection68495 Node: The meta-connection68618
Node: The meta-protocol69964 Node: The meta-protocol70087
Node: Security74973 Node: Security75096
Node: Authentication protocol76103 Node: Authentication protocol76226
Node: Encryption of network packets81107 Node: Encryption of network packets81230
Node: Security issues82480 Node: Security issues82603
Node: Platform specific information84097 Node: Platform specific information84220
Node: Interface configuration84325 Node: Interface configuration84448
Node: Routes86224 Node: Routes86347
Node: About us88140 Node: About us88263
Node: Contact information88315 Node: Contact information88438
Node: Authors88719 Node: Authors88842
Node: Concept Index89124 Node: Concept Index89247
 
End Tag Table End Tag Table

View file

@ -1638,6 +1638,8 @@ it defaults to the maximum time of 15 minutes.
Partially rereads configuration files. Partially rereads configuration files.
Connections to hosts whose host config file are removed are closed. Connections to hosts whose host config file are removed are closed.
New outgoing connections specified in @file{tinc.conf} will be made. New outgoing connections specified in @file{tinc.conf} will be made.
If the --logfile option is used, this will also close and reopen the log file,
useful when log rotation is used.
@item INT @item INT
Temporarily increases debug level to 5. Temporarily increases debug level to 5.

View file

@ -130,6 +130,10 @@ Connections to hosts whose host config file are removed are closed.
New outgoing connections specified in New outgoing connections specified in
.Pa tinc.conf .Pa tinc.conf
will be made. will be made.
If the
.Fl -logfile
option is used, this will also close and reopen the log file,
useful when log rotation is used.
.It INT .It INT
Temporarily increases debug level to 5. Temporarily increases debug level to 5.
Send this signal again to revert to the original level. Send this signal again to revert to the original level.

4
have.h
View file

@ -71,6 +71,10 @@
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif

View file

@ -27,6 +27,8 @@
#include "system.h" #include "system.h"
#include "pidfile.h"
#ifndef HAVE_MINGW #ifndef HAVE_MINGW
/* read_pid /* read_pid
* *
@ -34,7 +36,7 @@
* 0 is returned if either there's no pidfile, it's empty * 0 is returned if either there's no pidfile, it's empty
* or no pid can be read. * or no pid can be read.
*/ */
pid_t read_pid (char *pidfile) pid_t read_pid (const char *pidfile)
{ {
FILE *f; FILE *f;
long pid; long pid;
@ -53,7 +55,7 @@ pid_t read_pid (char *pidfile)
* table (using /proc) to determine if the process already exists. If * table (using /proc) to determine if the process already exists. If
* so the pid is returned, otherwise 0. * so the pid is returned, otherwise 0.
*/ */
pid_t check_pid (char *pidfile) pid_t check_pid (const char *pidfile)
{ {
pid_t pid = read_pid(pidfile); pid_t pid = read_pid(pidfile);
@ -79,7 +81,7 @@ pid_t check_pid (char *pidfile)
* Writes the pid to the specified file. If that fails 0 is * Writes the pid to the specified file. If that fails 0 is
* returned, otherwise the pid. * returned, otherwise the pid.
*/ */
pid_t write_pid (char *pidfile) pid_t write_pid (const char *pidfile)
{ {
FILE *f; FILE *f;
int fd; int fd;
@ -124,7 +126,7 @@ pid_t write_pid (char *pidfile)
* Remove the the specified file. The result from unlink(2) * Remove the the specified file. The result from unlink(2)
* is returned * is returned
*/ */
int remove_pid (char *pidfile) int remove_pid (const char *pidfile)
{ {
return unlink (pidfile); return unlink (pidfile);
} }

View file

@ -26,7 +26,7 @@
* 0 is returned if either there's no pidfile, it's empty * 0 is returned if either there's no pidfile, it's empty
* or no pid can be read. * or no pid can be read.
*/ */
pid_t read_pid (char *pidfile); extern pid_t read_pid (const char *pidfile);
/* check_pid /* check_pid
* *
@ -34,19 +34,19 @@ pid_t read_pid (char *pidfile);
* table (using /proc) to determine if the process already exists. If * table (using /proc) to determine if the process already exists. If
* so 1 is returned, otherwise 0. * so 1 is returned, otherwise 0.
*/ */
pid_t check_pid (char *pidfile); extern pid_t check_pid (const char *pidfile);
/* write_pid /* write_pid
* *
* Writes the pid to the specified file. If that fails 0 is * Writes the pid to the specified file. If that fails 0 is
* returned, otherwise the pid. * returned, otherwise the pid.
*/ */
pid_t write_pid (char *pidfile); extern pid_t write_pid (const char *pidfile);
/* remove_pid /* remove_pid
* *
* Remove the the specified file. The result from unlink(2) * Remove the the specified file. The result from unlink(2)
* is returned * is returned
*/ */
int remove_pid (char *pidfile); extern int remove_pid (const char *pidfile);
#endif #endif

View file

@ -23,9 +23,9 @@
#include "../src/logger.h" #include "../src/logger.h"
#include "utils.h" #include "utils.h"
const char hexadecimals[] = "0123456789ABCDEF"; static const char hexadecimals[] = "0123456789ABCDEF";
int charhex2bin(char c) { static int charhex2bin(char c) {
if(isdigit(c)) if(isdigit(c))
return c - '0'; return c - '0';
else else
@ -67,7 +67,7 @@ const char *winerror(int err) {
} }
#endif #endif
unsigned int bitfield_to_int(void *bitfield, size_t size) { unsigned int bitfield_to_int(const void *bitfield, size_t size) {
unsigned int value = 0; unsigned int value = 0;
if(size > sizeof value) if(size > sizeof value)
size = sizeof value; size = sizeof value;

View file

@ -40,6 +40,6 @@ extern const char *winerror(int);
#define sockinprogress(x) ((x) == EINPROGRESS) #define sockinprogress(x) ((x) == EINPROGRESS)
#endif #endif
extern unsigned int bitfield_to_int(void *bitfield, size_t size); extern unsigned int bitfield_to_int(const void *bitfield, size_t size);
#endif /* __TINC_UTILS_H__ */ #endif /* __TINC_UTILS_H__ */

View file

@ -16,7 +16,7 @@ extern int xalloc_exit_failure;
extern char *const xalloc_msg_memory_exhausted; extern char *const xalloc_msg_memory_exhausted;
/* FIXME: describe */ /* FIXME: describe */
extern void (*xalloc_fail_func) (); extern void (*xalloc_fail_func) (int);
void *xmalloc PARAMS ((size_t n)) __attribute__ ((__malloc__)); void *xmalloc PARAMS ((size_t n)) __attribute__ ((__malloc__));
void *xmalloc_and_zero PARAMS ((size_t n)) __attribute__ ((__malloc__)); void *xmalloc_and_zero PARAMS ((size_t n)) __attribute__ ((__malloc__));

View file

@ -56,7 +56,7 @@ int xalloc_exit_failure = EXIT_FAILURE;
char *const xalloc_msg_memory_exhausted = "Memory exhausted"; char *const xalloc_msg_memory_exhausted = "Memory exhausted";
/* FIXME: describe */ /* FIXME: describe */
void (*xalloc_fail_func) (int) = 0; void (*xalloc_fail_func) (int) = NULL;
static void static void
xalloc_fail (int size) xalloc_fail (int size)
@ -70,13 +70,12 @@ xalloc_fail (int size)
/* Allocate N bytes of memory dynamically, with error checking. */ /* Allocate N bytes of memory dynamically, with error checking. */
void * void *
xmalloc (n) xmalloc (size_t n)
size_t n;
{ {
void *p; void *p;
p = malloc (n); p = malloc (n);
if (p == 0) if (p == NULL)
xalloc_fail ((int)n); xalloc_fail ((int)n);
return p; return p;
} }
@ -84,13 +83,12 @@ xmalloc (n)
/* Allocate N bytes of memory dynamically, and set it all to zero. */ /* Allocate N bytes of memory dynamically, and set it all to zero. */
void * void *
xmalloc_and_zero (n) xmalloc_and_zero (size_t n)
size_t n;
{ {
void *p; void *p;
p = malloc (n); p = malloc (n);
if (p == 0) if (p == NULL)
xalloc_fail ((int)n); xalloc_fail ((int)n);
memset (p, '\0', n); memset (p, '\0', n);
return p; return p;
@ -101,12 +99,10 @@ xmalloc_and_zero (n)
If P is NULL, run xmalloc. */ If P is NULL, run xmalloc. */
void * void *
xrealloc (p, n) xrealloc (void *p, size_t n)
void *p;
size_t n;
{ {
p = realloc (p, n); p = realloc (p, n);
if (p == 0) if (p == NULL)
xalloc_fail (n); xalloc_fail (n);
return p; return p;
} }
@ -134,7 +130,7 @@ xcalloc (n, s)
void *p; void *p;
p = calloc (n, s); p = calloc (n, s);
if (p == 0) if (p == NULL)
xalloc_fail (); xalloc_fail ();
return p; return p;
} }

33
m4/ev.m4 Normal file
View file

@ -0,0 +1,33 @@
dnl Check to find the libev headers/libraries
AC_DEFUN([tinc_LIBEV],
[
AC_ARG_WITH(libev,
AS_HELP_STRING([--with-libev=DIR], [libev base directory, or:]),
[libev="$withval"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"]
)
AC_ARG_WITH(libev-include,
AS_HELP_STRING([--with-libev-include=DIR], [libev headers directory]),
[libev_include="$withval"
CPPFLAGS="$CPPFLAGS -I$withval"]
)
AC_ARG_WITH(libev-lib,
AS_HELP_STRING([--with-libev-lib=DIR], [libev library directory]),
[libev_lib="$withval"
LDFLAGS="$LDFLAGS -L$withval"]
)
AC_CHECK_HEADERS(ev.h,
[],
[AC_MSG_ERROR("ev header files not found."); break]
)
AC_CHECK_LIB(ev, ev_loop,
[LIBS="$LIBS -lev"],
[AC_MSG_ERROR("libev libraries not found.")]
)
])

View file

@ -2,6 +2,20 @@ dnl Check to find the OpenSSL headers/libraries
AC_DEFUN([tinc_OPENSSL], AC_DEFUN([tinc_OPENSSL],
[ [
case $host_os in
*mingw*)
;;
*)
AC_CHECK_FUNC(dlopen,
[],
[AC_CHECK_LIB(dl, dlopen,
[LIBS="$LIBS -ldl"],
[AC_MSG_ERROR([OpenSSL depends on libdl.]); break]
)]
)
;;
esac
AC_ARG_WITH(openssl, AC_ARG_WITH(openssl,
AS_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]), AS_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]),
[openssl="$withval" [openssl="$withval"
@ -31,20 +45,6 @@ AC_DEFUN([tinc_OPENSSL],
[AC_MSG_ERROR([OpenSSL libraries not found.])] [AC_MSG_ERROR([OpenSSL libraries not found.])]
) )
case $host_os in
*mingw*)
;;
*)
AC_CHECK_FUNC(dlopen,
[],
[AC_CHECK_LIB(dl, dlopen,
[LIBS="$LIBS -ldl"],
[AC_MSG_ERROR([OpenSSL depends on libdl.]); break]
)]
)
;;
esac
AC_CHECK_FUNCS([RAND_pseudo_bytes EVP_EncryptInit_ex], , 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_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
) )

View file

@ -30,7 +30,7 @@ endif
tincd_LDADD = \ tincd_LDADD = \
$(top_builddir)/lib/libvpn.a $(top_builddir)/lib/libvpn.a
AM_CFLAGS = @CFLAGS@ -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\"
dist-hook: dist-hook:
rm -f `find . -type l` rm -f `find . -type l`

View file

@ -197,7 +197,7 @@ noinst_HEADERS = conf.h connection.h device.h edge.h event.h graph.h logger.h me
tincd_LDADD = \ tincd_LDADD = \
$(top_builddir)/lib/libvpn.a $(top_builddir)/lib/libvpn.a
AM_CFLAGS = @CFLAGS@ -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\"
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:

View file

@ -22,6 +22,7 @@
#include "system.h" #include "system.h"
#include "conf.h" #include "conf.h"
#include "device.h"
#include "logger.h" #include "logger.h"
#include "net.h" #include "net.h"
#include "route.h" #include "route.h"

View file

@ -26,6 +26,7 @@
#include "avl_tree.h" #include "avl_tree.h"
#include "connection.h" #include "connection.h"
#include "conf.h" #include "conf.h"
#include "list.h"
#include "logger.h" #include "logger.h"
#include "netutl.h" /* for str2address */ #include "netutl.h" /* for str2address */
#include "protocol.h" #include "protocol.h"
@ -92,7 +93,7 @@ void config_add(avl_tree_t *config_tree, config_t *cfg) {
avl_insert(config_tree, cfg); avl_insert(config_tree, cfg);
} }
config_t *lookup_config(avl_tree_t *config_tree, char *variable) { config_t *lookup_config(const avl_tree_t *config_tree, char *variable) {
config_t cfg, *found; config_t cfg, *found;
cfg.variable = variable; cfg.variable = variable;
@ -110,7 +111,7 @@ config_t *lookup_config(avl_tree_t *config_tree, char *variable) {
return found; return found;
} }
config_t *lookup_config_next(avl_tree_t *config_tree, const config_t *cfg) { config_t *lookup_config_next(const avl_tree_t *config_tree, const config_t *cfg) {
avl_node_t *node; avl_node_t *node;
config_t *found; config_t *found;
@ -188,7 +189,7 @@ bool get_config_address(const config_t *cfg, struct addrinfo **result) {
} }
bool get_config_subnet(const config_t *cfg, subnet_t ** result) { bool get_config_subnet(const config_t *cfg, subnet_t ** result) {
subnet_t subnet = {0}; subnet_t subnet = {NULL};
if(!cfg) if(!cfg)
return false; return false;
@ -368,7 +369,7 @@ void read_config_options(avl_tree_t *config_tree, const char *prefix) {
} }
} }
bool read_server_config() { bool read_server_config(void) {
char *fname; char *fname;
bool x; bool x;

View file

@ -48,8 +48,8 @@ extern void exit_configuration(avl_tree_t **);
extern config_t *new_config(void) __attribute__ ((__malloc__)); extern config_t *new_config(void) __attribute__ ((__malloc__));
extern void free_config(config_t *); extern void free_config(config_t *);
extern void config_add(avl_tree_t *, config_t *); extern void config_add(avl_tree_t *, config_t *);
extern config_t *lookup_config(avl_tree_t *, char *); extern config_t *lookup_config(const avl_tree_t *, char *);
extern config_t *lookup_config_next(avl_tree_t *, const config_t *); extern config_t *lookup_config_next(const avl_tree_t *, const config_t *);
extern bool get_config_bool(const config_t *, bool *); extern bool get_config_bool(const config_t *, bool *);
extern bool get_config_int(const config_t *, int *); extern bool get_config_int(const config_t *, int *);
extern bool get_config_string(const config_t *, char **); extern bool get_config_string(const config_t *, char **);

View file

@ -23,10 +23,7 @@
#include "avl_tree.h" #include "avl_tree.h"
#include "conf.h" #include "conf.h"
#include "list.h"
#include "logger.h" #include "logger.h"
#include "net.h" /* Don't ask. */
#include "netutl.h"
#include "subnet.h" #include "subnet.h"
#include "utils.h" #include "utils.h"
#include "xalloc.h" #include "xalloc.h"

View file

@ -32,20 +32,19 @@
#define OPTION_CLAMP_MSS 0x0008 #define OPTION_CLAMP_MSS 0x0008
typedef struct connection_status_t { typedef struct connection_status_t {
int pinged:1; /* sent ping */ unsigned int pinged:1; /* sent ping */
int active:1; /* 1 if active.. */ unsigned int active:1; /* 1 if active.. */
int connecting:1; /* 1 if we are waiting for a non-blocking connect() to finish */ unsigned int connecting:1; /* 1 if we are waiting for a non-blocking connect() to finish */
int termreq:1; /* the termination of this connection was requested */ unsigned int termreq:1; /* the termination of this connection was requested */
int remove:1; /* Set to 1 if you want this connection removed */ unsigned int remove:1; /* Set to 1 if you want this connection removed */
int timeout:1; /* 1 if gotten timeout */ unsigned int timeout:1; /* 1 if gotten timeout */
int encryptout:1; /* 1 if we can encrypt outgoing traffic */ unsigned int encryptout:1; /* 1 if we can encrypt outgoing traffic */
int decryptin:1; /* 1 if we have to decrypt incoming traffic */ unsigned int decryptin:1; /* 1 if we have to decrypt incoming traffic */
int mst:1; /* 1 if this connection is part of a minimum spanning tree */ unsigned int mst:1; /* 1 if this connection is part of a minimum spanning tree */
int unused:23; unsigned int unused:23;
} connection_status_t; } connection_status_t;
#include "edge.h" #include "edge.h"
#include "list.h"
#include "net.h" #include "net.h"
#include "node.h" #include "node.h"

View file

@ -24,6 +24,7 @@
#include <w32api/winioctl.h> #include <w32api/winioctl.h>
#include "conf.h" #include "conf.h"
#include "device.h"
#include "logger.h" #include "logger.h"
#include "net.h" #include "net.h"
#include "route.h" #include "route.h"

View file

@ -28,7 +28,7 @@
avl_tree_t *event_tree; avl_tree_t *event_tree;
extern time_t now; extern time_t now;
int id; static int id;
static int event_compare(const event_t *a, const event_t *b) { static int event_compare(const event_t *a, const event_t *b) {
if(a->time > b->time) if(a->time > b->time)
@ -62,10 +62,10 @@ void expire_events(void) {
return; return;
event = event_tree->tail->data; event = event_tree->tail->data;
if(event->time < now) if(event->time <= now)
return; return;
diff = 1 + event->time - now; diff = event->time - now;
for(node = event_tree->head; node; node = node->next) { for(node = event_tree->head; node; node = node->next) {
event = node->data; event = node->data;
@ -96,7 +96,7 @@ event_t *get_expired_event(void) {
if(event_tree->head) { if(event_tree->head) {
event = event_tree->head->data; event = event_tree->head->data;
if(event->time < now) { if(event->time <= now) {
avl_node_t *node = event_tree->head; avl_node_t *node = event_tree->head;
avl_unlink_node(event_tree, node); avl_unlink_node(event_tree, node);
free(node); free(node);
@ -106,3 +106,9 @@ event_t *get_expired_event(void) {
return NULL; return NULL;
} }
event_t *peek_next_event(void) {
if (event_tree->head)
return event_tree->head->data;
return NULL;
}

View file

@ -42,5 +42,6 @@ extern void free_event(event_t *);
extern void event_add(event_t *); extern void event_add(event_t *);
extern void event_del(event_t *); extern void event_del(event_t *);
extern event_t *get_expired_event(void); extern event_t *get_expired_event(void);
extern event_t *peek_next_event(void);
#endif /* __TINC_EVENT_H__ */ #endif /* __TINC_EVENT_H__ */

View file

@ -49,6 +49,7 @@
#include "connection.h" #include "connection.h"
#include "device.h" #include "device.h"
#include "edge.h" #include "edge.h"
#include "graph.h"
#include "logger.h" #include "logger.h"
#include "netutl.h" #include "netutl.h"
#include "node.h" #include "node.h"
@ -65,7 +66,7 @@ static bool graph_changed = true;
Please note that sorting on weight is already done by add_edge(). Please note that sorting on weight is already done by add_edge().
*/ */
void mst_kruskal(void) { static void mst_kruskal(void) {
avl_node_t *node, *next; avl_node_t *node, *next;
edge_t *e; edge_t *e;
node_t *n; node_t *n;
@ -146,7 +147,7 @@ void mst_kruskal(void) {
Running time: O(E) Running time: O(E)
*/ */
void sssp_bfs(void) { static void sssp_bfs(void) {
avl_node_t *node, *next, *to; avl_node_t *node, *next, *to;
edge_t *e; edge_t *e;
node_t *n; node_t *n;

View file

@ -22,8 +22,6 @@
#define __TINC_GRAPH_H__ #define __TINC_GRAPH_H__
extern void graph(void); extern void graph(void);
extern void mst_kruskal(void);
extern void sssp_bfs(void);
extern void dump_graph(void); extern void dump_graph(void);
#endif /* __TINC_GRAPH_H__ */ #endif /* __TINC_GRAPH_H__ */

View file

@ -28,6 +28,7 @@
#endif #endif
#include "conf.h" #include "conf.h"
#include "device.h"
#include "logger.h" #include "logger.h"
#include "net.h" #include "net.h"
#include "route.h" #include "route.h"

View file

@ -44,14 +44,18 @@ void openlogger(const char *ident, logmode_t mode) {
case LOGMODE_FILE: case LOGMODE_FILE:
logpid = getpid(); logpid = getpid();
logfile = fopen(logfilename, "a"); logfile = fopen(logfilename, "a");
if(!logfile) if(!logfile) {
fprintf(stderr, "Could not open log file %s: %s\n", logfilename, strerror(errno));
logmode = LOGMODE_NULL; logmode = LOGMODE_NULL;
}
break; break;
case LOGMODE_SYSLOG: case LOGMODE_SYSLOG:
#ifdef HAVE_MINGW #ifdef HAVE_MINGW
loghandle = RegisterEventSource(NULL, logident); loghandle = RegisterEventSource(NULL, logident);
if(!loghandle) if(!loghandle) {
fprintf(stderr, "Could not open log handle!");
logmode = LOGMODE_NULL; logmode = LOGMODE_NULL;
}
break; break;
#else #else
#ifdef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H
@ -64,8 +68,24 @@ void openlogger(const char *ident, logmode_t mode) {
} }
} }
void reopenlogger() {
if(logmode != LOGMODE_FILE)
return;
fflush(logfile);
FILE *newfile = fopen(logfilename, "a");
if(!newfile) {
logger(LOG_ERR, "Unable to reopen log file %s: %s\n", logfilename, strerror(errno));
return;
}
fclose(logfile);
logfile = newfile;
}
void logger(int priority, const char *format, ...) { void logger(int priority, const char *format, ...) {
va_list ap; va_list ap;
char timestr[32] = "";
time_t now;
va_start(ap, format); va_start(ap, format);
@ -76,7 +96,9 @@ void logger(int priority, const char *format, ...) {
fflush(stderr); fflush(stderr);
break; break;
case LOGMODE_FILE: case LOGMODE_FILE:
fprintf(logfile, "%ld %s[%ld]: ", time(NULL), logident, (long)logpid); now = time(NULL);
strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now));
fprintf(logfile, "%s %s[%ld]: ", timestr, logident, (long)logpid);
vfprintf(logfile, format, ap); vfprintf(logfile, format, ap);
fprintf(logfile, "\n"); fprintf(logfile, "\n");
fflush(logfile); fflush(logfile);

View file

@ -47,6 +47,7 @@ enum {
extern debug_t debug_level; extern debug_t debug_level;
extern void openlogger(const char *, logmode_t); extern void openlogger(const char *, logmode_t);
extern void reopenlogger(void);
extern void logger(int, const char *, ...) __attribute__ ((__format__(printf, 2, 3))); extern void logger(int, const char *, ...) __attribute__ ((__format__(printf, 2, 3)));
extern void closelogger(void); extern void closelogger(void);

View file

@ -24,6 +24,7 @@
#include <winioctl.h> #include <winioctl.h>
#include "conf.h" #include "conf.h"
#include "device.h"
#include "logger.h" #include "logger.h"
#include "net.h" #include "net.h"
#include "route.h" #include "route.h"

View file

@ -3,6 +3,7 @@
Copyright (C) 1998-2005 Ivo Timmermans, Copyright (C) 1998-2005 Ivo Timmermans,
2000-2011 Guus Sliepen <guus@tinc-vpn.org> 2000-2011 Guus Sliepen <guus@tinc-vpn.org>
2006 Scott Lamb <slamb@slamb.org> 2006 Scott Lamb <slamb@slamb.org>
2011 Loïc Grenié <loic.grenie@gmail.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -42,6 +43,9 @@
bool do_purge = false; bool do_purge = false;
volatile bool running = false; volatile bool running = false;
#ifdef HAVE_PSELECT
bool graph_dump = false;
#endif
time_t now = 0; time_t now = 0;
int contradicting_add_edge = 0; int contradicting_add_edge = 0;
@ -229,14 +233,14 @@ static void check_dead_connections(void) {
next = node->next; next = node->next;
c = node->data; c = node->data;
if(c->last_ping_time + pingtimeout < now) { if(c->last_ping_time + pingtimeout <= now) {
if(c->status.active) { if(c->status.active) {
if(c->status.pinged) { if(c->status.pinged) {
ifdebug(CONNECTIONS) logger(LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", ifdebug(CONNECTIONS) logger(LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds",
c->name, c->hostname, now - c->last_ping_time); c->name, c->hostname, now - c->last_ping_time);
c->status.timeout = true; c->status.timeout = true;
terminate_connection(c, true); terminate_connection(c, true);
} else if(c->last_ping_time + pinginterval < now) { } else if(c->last_ping_time + pinginterval <= now) {
send_ping(c); send_ping(c);
} }
} else { } else {
@ -258,7 +262,7 @@ static void check_dead_connections(void) {
} }
} }
if(c->outbuflen > 0 && c->last_flushed_time + pingtimeout < now) { if(c->outbuflen > 0 && c->last_flushed_time + pingtimeout <= now) {
if(c->status.active) { if(c->status.active) {
ifdebug(CONNECTIONS) logger(LOG_INFO, ifdebug(CONNECTIONS) logger(LOG_INFO,
"%s (%s) could not flush for %ld seconds (%d bytes remaining)", "%s (%s) could not flush for %ld seconds (%d bytes remaining)",
@ -350,7 +354,13 @@ static void check_network_activity(fd_set * readset, fd_set * writeset) {
*/ */
int main_loop(void) { int main_loop(void) {
fd_set readset, writeset; fd_set readset, writeset;
#ifdef HAVE_PSELECT
struct timespec tv;
sigset_t omask, block_mask;
time_t next_event;
#else
struct timeval tv; struct timeval tv;
#endif
int r, maxfd; int r, maxfd;
time_t last_ping_check, last_config_check, last_graph_dump; time_t last_ping_check, last_config_check, last_graph_dump;
event_t *event; event_t *event;
@ -361,21 +371,48 @@ int main_loop(void) {
srand(now); srand(now);
#ifdef HAVE_PSELECT
if(lookup_config(config_tree, "GraphDumpFile"))
graph_dump = true;
/* Block SIGHUP & SIGALRM */
sigemptyset(&block_mask);
sigaddset(&block_mask, SIGHUP);
sigaddset(&block_mask, SIGALRM);
sigprocmask(SIG_BLOCK, &block_mask, &omask);
#endif
running = true; running = true;
while(running) { while(running) {
now = time(NULL); #ifdef HAVE_PSELECT
next_event = last_ping_check + pingtimeout;
if(graph_dump && next_event > last_graph_dump + 60)
next_event = last_graph_dump + 60;
// tv.tv_sec = 1 + (rand() & 7); /* Approx. 5 seconds, randomized to prevent global synchronisation effects */ if((event = peek_next_event()) && next_event > event->time)
next_event = event->time;
if(next_event <= now)
tv.tv_sec = 0;
else
tv.tv_sec = next_event - now;
tv.tv_nsec = 0;
#else
tv.tv_sec = 1; tv.tv_sec = 1;
tv.tv_usec = 0; tv.tv_usec = 0;
#endif
maxfd = build_fdset(&readset, &writeset); maxfd = build_fdset(&readset, &writeset);
#ifdef HAVE_MINGW #ifdef HAVE_MINGW
LeaveCriticalSection(&mutex); LeaveCriticalSection(&mutex);
#endif #endif
#ifdef HAVE_PSELECT
r = pselect(maxfd + 1, &readset, &writeset, NULL, &tv, &omask);
#else
r = select(maxfd + 1, &readset, &writeset, NULL, &tv); r = select(maxfd + 1, &readset, &writeset, NULL, &tv);
#endif
now = time(NULL);
#ifdef HAVE_MINGW #ifdef HAVE_MINGW
EnterCriticalSection(&mutex); EnterCriticalSection(&mutex);
#endif #endif
@ -398,7 +435,7 @@ int main_loop(void) {
/* Let's check if everybody is still alive */ /* Let's check if everybody is still alive */
if(last_ping_check + pingtimeout < now) { if(last_ping_check + pingtimeout <= now) {
check_dead_connections(); check_dead_connections();
last_ping_check = now; last_ping_check = now;
@ -409,7 +446,7 @@ int main_loop(void) {
/* Should we regenerate our key? */ /* Should we regenerate our key? */
if(keyexpires < now) { if(keyexpires <= now) {
avl_node_t *node; avl_node_t *node;
node_t *n; node_t *n;
@ -423,7 +460,7 @@ int main_loop(void) {
} }
} }
send_key_changed(broadcast, myself); send_key_changed();
keyexpires = now + keylifetime; keyexpires = now + keylifetime;
} }
@ -464,6 +501,8 @@ int main_loop(void) {
struct stat s; struct stat s;
sighup = false; sighup = false;
reopenlogger();
/* Reread our own configuration file */ /* Reread our own configuration file */
@ -550,11 +589,16 @@ int main_loop(void) {
/* Dump graph if wanted every 60 seconds*/ /* Dump graph if wanted every 60 seconds*/
if(last_graph_dump + 60 < now) { if(last_graph_dump + 60 <= now) {
dump_graph(); dump_graph();
last_graph_dump = now; last_graph_dump = now;
} }
} }
#ifdef HAVE_PSELECT
/* Restore SIGHUP & SIGALARM mask */
sigprocmask(SIG_SETMASK, &omask, NULL);
#endif
return 0; return 0;
} }

View file

@ -121,6 +121,8 @@ extern time_t now;
extern int contradicting_add_edge; extern int contradicting_add_edge;
extern int contradicting_del_edge; extern int contradicting_del_edge;
extern volatile bool running;
/* Yes, very strange placement indeed, but otherwise the typedefs get all tangled up */ /* Yes, very strange placement indeed, but otherwise the typedefs get all tangled up */
#include "connection.h" #include "connection.h"
#include "node.h" #include "node.h"
@ -133,7 +135,7 @@ extern bool handle_new_meta_connection(int);
extern int setup_listen_socket(const sockaddr_t *); extern int setup_listen_socket(const sockaddr_t *);
extern int setup_vpn_in_socket(const sockaddr_t *); extern int setup_vpn_in_socket(const sockaddr_t *);
extern void send_packet(const struct node_t *, vpn_packet_t *); extern void send_packet(const struct node_t *, vpn_packet_t *);
extern void receive_tcppacket(struct connection_t *, char *, int); extern void receive_tcppacket(struct connection_t *, const char *, int);
extern void broadcast_packet(const struct node_t *, vpn_packet_t *); extern void broadcast_packet(const struct node_t *, vpn_packet_t *);
extern bool setup_network(void); extern bool setup_network(void);
extern void setup_outgoing_connection(struct outgoing_t *); extern void setup_outgoing_connection(struct outgoing_t *);
@ -144,7 +146,7 @@ extern void terminate_connection(struct connection_t *, bool);
extern void flush_queue(struct node_t *); extern void flush_queue(struct node_t *);
extern bool read_rsa_public_key(struct connection_t *); extern bool read_rsa_public_key(struct connection_t *);
extern void send_mtu_probe(struct node_t *); extern void send_mtu_probe(struct node_t *);
extern void load_all_subnets(); extern void load_all_subnets(void);
#ifndef HAVE_MINGW #ifndef HAVE_MINGW
#define closesocket(s) close(s) #define closesocket(s) close(s)

View file

@ -43,7 +43,6 @@
#include "ethernet.h" #include "ethernet.h"
#include "event.h" #include "event.h"
#include "graph.h" #include "graph.h"
#include "list.h"
#include "logger.h" #include "logger.h"
#include "net.h" #include "net.h"
#include "netutl.h" #include "netutl.h"
@ -365,7 +364,7 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
receive_packet(n, inpkt); receive_packet(n, inpkt);
} }
void receive_tcppacket(connection_t *c, char *buffer, int len) { void receive_tcppacket(connection_t *c, const char *buffer, int len) {
vpn_packet_t outpkt; vpn_packet_t outpkt;
outpkt.len = len; outpkt.len = len;
@ -404,7 +403,7 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
"No valid key known yet for %s (%s), forwarding via TCP", "No valid key known yet for %s (%s), forwarding via TCP",
n->name, n->hostname); n->name, n->hostname);
if(n->last_req_key + 10 < now) { if(n->last_req_key + 10 <= now) {
send_req_key(n); send_req_key(n);
n->last_req_key = now; n->last_req_key = now;
} }

View file

@ -144,7 +144,7 @@ bool read_rsa_public_key(connection_t *c) {
return false; return false;
} }
bool read_rsa_private_key(void) { static bool read_rsa_private_key(void) {
FILE *fp; FILE *fp;
char *fname, *key, *pubkey; char *fname, *key, *pubkey;
struct stat s; struct stat s;
@ -267,7 +267,7 @@ void load_all_subnets(void) {
/* /*
Configure node_t myself and set up the local sockets (listen only) Configure node_t myself and set up the local sockets (listen only)
*/ */
bool setup_myself(void) { static bool setup_myself(void) {
config_t *cfg; config_t *cfg;
subnet_t *subnet; subnet_t *subnet;
char *name, *hostname, *mode, *afname, *cipher, *digest; char *name, *hostname, *mode, *afname, *cipher, *digest;

View file

@ -535,7 +535,7 @@ bool handle_new_meta_connection(int sock) {
return true; return true;
} }
void free_outgoing(outgoing_t *outgoing) { static void free_outgoing(outgoing_t *outgoing) {
if(outgoing->ai) if(outgoing->ai)
freeaddrinfo(outgoing->ai); freeaddrinfo(outgoing->ai);

View file

@ -124,7 +124,7 @@ void node_del(node_t *n) {
} }
node_t *lookup_node(char *name) { node_t *lookup_node(char *name) {
node_t n = {0}; node_t n = {NULL};
n.name = name; n.name = name;
@ -132,7 +132,7 @@ node_t *lookup_node(char *name) {
} }
node_t *lookup_node_udp(const sockaddr_t *sa) { node_t *lookup_node_udp(const sockaddr_t *sa) {
node_t n = {0}; node_t n = {NULL};
n.address = *sa; n.address = *sa;
n.name = NULL; n.name = NULL;
@ -142,7 +142,7 @@ node_t *lookup_node_udp(const sockaddr_t *sa) {
void update_node_udp(node_t *n, const sockaddr_t *sa) { void update_node_udp(node_t *n, const sockaddr_t *sa) {
if(n == myself) { if(n == myself) {
logger(LOG_WARNING, "Trying to update UDP address of myself!\n"); logger(LOG_WARNING, "Trying to update UDP address of myself!");
return; return;
} }
@ -158,7 +158,7 @@ void update_node_udp(node_t *n, const sockaddr_t *sa) {
ifdebug(PROTOCOL) logger(LOG_DEBUG, "UDP address of %s set to %s", n->name, n->hostname); ifdebug(PROTOCOL) logger(LOG_DEBUG, "UDP address of %s set to %s", n->name, n->hostname);
} else { } else {
memset(&n->address, 0, sizeof n->address); memset(&n->address, 0, sizeof n->address);
n->hostname = 0; n->hostname = NULL;
ifdebug(PROTOCOL) logger(LOG_DEBUG, "UDP address of %s cleared", n->name); ifdebug(PROTOCOL) logger(LOG_DEBUG, "UDP address of %s cleared", n->name);
} }
} }

View file

@ -24,17 +24,16 @@
#include "avl_tree.h" #include "avl_tree.h"
#include "connection.h" #include "connection.h"
#include "event.h" #include "event.h"
#include "list.h"
#include "subnet.h" #include "subnet.h"
typedef struct node_status_t { typedef struct node_status_t {
int unused_active:1; /* 1 if active (not used for nodes) */ unsigned int unused_active:1; /* 1 if active (not used for nodes) */
int validkey:1; /* 1 if we currently have a valid key for him */ unsigned int validkey:1; /* 1 if we currently have a valid key for him */
int unused_waitingforkey:1; /* 1 if we already sent out a request */ unsigned int unused_waitingforkey:1; /* 1 if we already sent out a request */
int visited:1; /* 1 if this node has been visited by one of the graph algorithms */ unsigned int visited:1; /* 1 if this node has been visited by one of the graph algorithms */
int reachable:1; /* 1 if this node is reachable in the graph */ unsigned int reachable:1; /* 1 if this node is reachable in the graph */
int indirect:1; /* 1 if this node is not directly reachable by us */ unsigned int indirect:1; /* 1 if this node is not directly reachable by us */
int unused:26; unsigned int unused:26;
} node_status_t; } node_status_t;
typedef struct node_t { typedef struct node_t {

View file

@ -25,6 +25,7 @@
#include "device.h" #include "device.h"
#include "edge.h" #include "edge.h"
#include "logger.h" #include "logger.h"
#include "net.h"
#include "node.h" #include "node.h"
#include "pidfile.h" #include "pidfile.h"
#include "process.h" #include "process.h"
@ -41,10 +42,9 @@ extern char *identname;
extern char *pidfilename; extern char *pidfilename;
extern char **g_argv; extern char **g_argv;
extern bool use_logfile; extern bool use_logfile;
extern volatile bool running;
#ifndef HAVE_MINGW #ifndef HAVE_MINGW
sigset_t emptysigset; static sigset_t emptysigset;
#endif #endif
static int saved_debug_level = -1; static int saved_debug_level = -1;

View file

@ -189,7 +189,7 @@ void exit_requests(void) {
} }
bool seen_request(char *request) { bool seen_request(char *request) {
past_request_t *new, p = {0}; past_request_t *new, p = {NULL};
p.request = request; p.request = request;
@ -214,7 +214,7 @@ void age_past_requests(void) {
next = node->next; next = node->next;
p = node->data; p = node->data;
if(p->firstseen + pinginterval < now) if(p->firstseen + pinginterval <= now)
avl_delete_node(past_request_tree, node), deleted++; avl_delete_node(past_request_tree, node), deleted++;
else else
left++; left++;

View file

@ -96,10 +96,10 @@ extern bool send_add_subnet(struct connection_t *, const struct subnet_t *);
extern bool send_del_subnet(struct connection_t *, const struct subnet_t *); extern bool send_del_subnet(struct connection_t *, const struct subnet_t *);
extern bool send_add_edge(struct connection_t *, const struct edge_t *); extern bool send_add_edge(struct connection_t *, const struct edge_t *);
extern bool send_del_edge(struct connection_t *, const struct edge_t *); extern bool send_del_edge(struct connection_t *, const struct edge_t *);
extern void send_key_changed(); extern void send_key_changed(void);
extern bool send_req_key(struct node_t *); extern bool send_req_key(struct node_t *);
extern bool send_ans_key(struct node_t *); extern bool send_ans_key(struct node_t *);
extern bool send_tcppacket(struct connection_t *, struct vpn_packet_t *); extern bool send_tcppacket(struct connection_t *, const struct vpn_packet_t *);
/* Request handlers */ /* Request handlers */

View file

@ -34,9 +34,9 @@
#include "utils.h" #include "utils.h"
#include "xalloc.h" #include "xalloc.h"
bool mykeyused = false; static bool mykeyused = false;
void send_key_changed() { void send_key_changed(void) {
avl_node_t *node; avl_node_t *node;
connection_t *c; connection_t *c;

View file

@ -119,7 +119,7 @@ bool pong_h(connection_t *c) {
/* Sending and receiving packets via TCP */ /* Sending and receiving packets via TCP */
bool send_tcppacket(connection_t *c, vpn_packet_t *packet) { bool send_tcppacket(connection_t *c, const vpn_packet_t *packet) {
/* If there already is a lot of data in the outbuf buffer, discard this packet. /* If there already is a lot of data in the outbuf buffer, discard this packet.
We use a very simple Random Early Drop algorithm. */ We use a very simple Random Early Drop algorithm. */

View file

@ -45,7 +45,7 @@ bool add_subnet_h(connection_t *c) {
char subnetstr[MAX_STRING_SIZE]; char subnetstr[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE]; char name[MAX_STRING_SIZE];
node_t *owner; node_t *owner;
subnet_t s = {0}, *new, *old; subnet_t s = {NULL}, *new, *old;
if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) { if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
logger(LOG_ERR, "Got bad %s from %s (%s)", "ADD_SUBNET", c->name, logger(LOG_ERR, "Got bad %s from %s (%s)", "ADD_SUBNET", c->name,
@ -154,7 +154,7 @@ bool del_subnet_h(connection_t *c) {
char subnetstr[MAX_STRING_SIZE]; char subnetstr[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE]; char name[MAX_STRING_SIZE];
node_t *owner; node_t *owner;
subnet_t s = {0}, *find; subnet_t s = {NULL}, *find;
if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) { if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
logger(LOG_ERR, "Got bad %s from %s (%s)", "DEL_SUBNET", c->name, logger(LOG_ERR, "Got bad %s from %s (%s)", "DEL_SUBNET", c->name,

View file

@ -23,6 +23,7 @@
#include <netpacket/packet.h> #include <netpacket/packet.h>
#include "conf.h" #include "conf.h"
#include "device.h"
#include "net.h" #include "net.h"
#include "logger.h" #include "logger.h"
#include "utils.h" #include "utils.h"

View file

@ -220,7 +220,7 @@ void age_subnets(void) {
for(node = myself->subnet_tree->head; node; node = next) { for(node = myself->subnet_tree->head; node; node = next) {
next = node->next; next = node->next;
s = node->data; s = node->data;
if(s->expires && s->expires < now) { if(s->expires && s->expires <= now) {
ifdebug(TRAFFIC) { ifdebug(TRAFFIC) {
char netstr[MAXNETSTR]; char netstr[MAXNETSTR];
if(net2str(netstr, sizeof netstr, s)) if(net2str(netstr, sizeof netstr, s))

View file

@ -26,6 +26,7 @@
#include <net/if_tun.h> #include <net/if_tun.h>
#include "conf.h" #include "conf.h"
#include "device.h"
#include "logger.h" #include "logger.h"
#include "net.h" #include "net.h"
#include "utils.h" #include "utils.h"

View file

@ -52,7 +52,7 @@ static subnet_t *cache_mac_subnet[2];
static bool cache_mac_valid[2]; static bool cache_mac_valid[2];
static int cache_mac_slot; static int cache_mac_slot;
void subnet_cache_flush() { void subnet_cache_flush(void) {
cache_ipv4_valid[0] = cache_ipv4_valid[1] = false; cache_ipv4_valid[0] = cache_ipv4_valid[1] = false;
cache_ipv6_valid[0] = cache_ipv6_valid[1] = false; cache_ipv6_valid[0] = cache_ipv6_valid[1] = false;
cache_mac_valid[0] = cache_mac_valid[1] = false; cache_mac_valid[0] = cache_mac_valid[1] = false;
@ -273,7 +273,7 @@ bool str2net(subnet_t *subnet, const char *subnetstr) {
bool net2str(char *netstr, int len, const subnet_t *subnet) { bool net2str(char *netstr, int len, const subnet_t *subnet) {
if(!netstr || !subnet) { if(!netstr || !subnet) {
logger(LOG_ERR, "net2str() was called with netstr=%p, subnet=%p!\n", netstr, subnet); logger(LOG_ERR, "net2str() was called with netstr=%p, subnet=%p!", netstr, subnet);
return false; return false;
} }
@ -451,7 +451,7 @@ subnet_t *lookup_subnet_ipv6(const ipv6_t *address) {
void subnet_update(node_t *owner, subnet_t *subnet, bool up) { void subnet_update(node_t *owner, subnet_t *subnet, bool up) {
avl_node_t *node; avl_node_t *node;
int i; int i;
char *envp[9] = {0}; char *envp[9] = {NULL};
char netstr[MAXNETSTR]; char netstr[MAXNETSTR];
char *name, *address, *port; char *name, *address, *port;
char empty[] = ""; char empty[] = "";

View file

@ -504,7 +504,7 @@ static bool drop_privs() {
} }
#ifdef HAVE_MINGW #ifdef HAVE_MINGW
# define setpriority(level) SetPriorityClass(GetCurrentProcess(), (level)) # define setpriority(level) !SetPriorityClass(GetCurrentProcess(), (level))
#else #else
# define NORMAL_PRIORITY_CLASS 0 # define NORMAL_PRIORITY_CLASS 0
# define BELOW_NORMAL_PRIORITY_CLASS 10 # define BELOW_NORMAL_PRIORITY_CLASS 10

View file

@ -23,6 +23,7 @@
#include <sys/un.h> #include <sys/un.h>
#include "conf.h" #include "conf.h"
#include "device.h"
#include "net.h" #include "net.h"
#include "logger.h" #include "logger.h"
#include "utils.h" #include "utils.h"