Commit graph

1539 commits

Author SHA1 Message Date
Guus Sliepen
3b1fad04de Allow setting DeviceType to tun or tap on Linux. 2012-02-18 14:37:52 +01:00
Guus Sliepen
6455654d26 Send packets back using the same socket as they were received on. 2012-02-18 11:48:21 +01:00
Guus Sliepen
178e52f76e Allow linking with multiple device drivers.
Apart from the platform specific tun/tap driver, link with the dummy and
raw_socket devices, and optionally with support for UML and VDE devices.
At runtime, the DeviceType option can be used to select which driver to
use.
2011-12-04 01:20:59 +01:00
Guus Sliepen
5672863e59 Fix a few small memory leaks. 2011-12-03 21:59:47 +01:00
Guus Sliepen
52ded09d17 Add vde/device.c to the tarball. 2011-11-27 12:13:16 +01:00
Guus Sliepen
2c7c87ec75 Fix compilation of VDE and UML interfaces. 2011-11-27 12:12:34 +01:00
Guus Sliepen
ddea7a23a6 Return false instead of void when there is an error. 2011-08-30 20:49:48 +02:00
Guus Sliepen
e838289683 Prevent read_rsa_public_key() from returning an uninitialized RSA structure.
In case the config file could not be opened a new but unitialized RSA structure
would be returned, causing a segmentation fault later on. This would only
happen in the case that the config file could be opened before, but not when
read_rsa_public_key() was called. This situation could occur when the --user
option was used, and the config files were not readable by the specified user.
2011-08-30 20:04:18 +02:00
Guus Sliepen
0f2aa4bd8b Releasing 1.0.16. 2011-07-23 14:12:23 +02:00
Guus Sliepen
e16ead8dd9 Use usleep() instead of sleep(), MinGW complained. 2011-07-23 14:11:44 +02:00
Guus Sliepen
50fcfea127 Flush output buffer in send_tcppacket().
This is mainly important for Windows, where the select() call in the
main thread is not being woken up when the tapreader thread calls
route(), causing a delay of up to 1 second before the output buffer is
flushed. This would cause bad performance when UDP communication is not
possible.
2011-07-17 19:34:01 +02:00
Guus Sliepen
be2fc8b045 Make code to detect two nodes with the same Name less triggerhappy.
First of all, if there really are two nodes with the same name, much
more than 10 contradicting ADD_EDGE and DEL_EDGE messages will be sent.
Also, we forgot to reset the counters when nothing happened.

In case there is a ADD_EDGE/DEL_EDGE storm, we do not shut down, but
sleep an increasing amount of time, allowing tinc to recover gracefully
from temporary failures.
2011-07-16 10:47:35 +02:00
Guus Sliepen
05260f941c Releasing 1.0.15. 2011-06-24 14:50:20 +02:00
Guus Sliepen
3c0511984f Remove redundant @CFLAGS@ from AM_CFLAGS. 2011-06-24 12:27:04 +02:00
Guus Sliepen
4b3fd94b1c 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.
2011-06-06 16:26:11 +02:00
Guus Sliepen
b3bbeab6e6 Attribution for Loïc Grenié. 2011-06-04 11:27:54 +02:00
Loïc Grenié
50af33d01f 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.
2011-06-04 11:19:46 +02:00
Guus Sliepen
64771f73eb Remove a few unnecessary #includes.
Some spotted by Michael Tokarev.
2011-05-28 23:46:56 +02:00
Guus Sliepen
5cff8c47c1 Remove newlines from log messages. 2011-05-28 23:42:18 +02:00
Guus Sliepen
6d08eb1614 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.
2011-05-28 23:36:52 +02:00
Guus Sliepen
07ffb1a198 Make return value of SetPriorityClass() behave the same as setpriority(). 2011-05-22 15:56:04 +02:00
Guus Sliepen
03b7118139 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.
2011-05-13 12:37:26 +02:00
Guus Sliepen
5686ad80b5 Releasing 1.0.14. 2011-05-08 23:17:46 +02:00
Guus Sliepen
0d906489f2 Include <inttypes.h> when using intptr_t. 2011-05-08 23:12:44 +02:00
Guus Sliepen
dc887f5011 Ensure proper linking with OpenSSL with recent versions of MinGW. 2011-05-08 23:12:06 +02:00
Guus Sliepen
67766d65f0 Update THANKS and copyright information. 2011-05-08 21:22:20 +02:00
Guus Sliepen
6e6b037ef4 Check for EVP_EncryptInit_ex instead of SHA1_Version in OpenSSL.
The latter function disappeared, and wasn't actually used in tinc, so now we
check on a function that we do use.
2011-05-08 21:06:06 +02:00
Guus Sliepen
257cb6ac60 Always use the default signal handler for ABRT signals.
This will allow coredumps to be generated when tinc is daemonized.
Also add the -kABRT option.
2011-05-08 12:40:44 +02:00
Guus Sliepen
eacb5a28fb Increase threshold for detecting two nodes with the same Name.
In commit 4a21aabada, code was added to detect
contradicting ADD_EDGE and DEL_EDGE messages being sent, which is an indication
of two nodes with the same Name connected to the same VPN.  However, these
contradictory messages can also happen when there is a network partitioning. In
the former case a loop happens which causes many contradictory message, while
in the latter case only a few of those messages will be sent. So, now we
increase the threshold to at least 10 of both ADD_EDGE and DEL_EDGE messages.
2011-05-08 12:16:26 +02:00
Julien Muchembled
f11c6101f3 Fix command-line '-o' option for host configuration
This fixes a regression introduced by commit 667b1ba while refactoring option
parsing code.
2011-04-28 14:30:32 +02:00
Guus Sliepen
0aa86d4b8b Do not set indirect flag on edges from nodes with multiple addresses.
Since tinc now handles UDP packets with a different source address and port
than used for TCP connections, the heuristic to treat edges as indirect when
tinc could detect that multiple addresses were used does not make sense
anymore, and can actually reduce performance.
2011-03-09 09:34:56 +01:00
Guus Sliepen
7cf68b5e35 Prevent anything from updating our own UDP address.
Because we don't want to keep track of that, and this will cause the node
structure from being relinked into the node tree, which results in myself
pointing to an invalid address.
2011-02-18 23:11:43 +01:00
Guus Sliepen
cdbbbfabea Fix spurious misidentification of incoming UDP packets.
When a UDP packet was received with an unknown source address/port, and if it
failed a HMAC check against known keys, it could still incorrectly assign that
UDP address to another node. This would temporarily cause outgoing UDP packets
to go to the wrong destination address, until packets from the correct address
were received again.
2011-02-18 23:02:11 +01:00
Rumko
046d83bf91 DragonFlyBSD support
* added DragonFly BSD support
* added a check for sys/resource.h (needed on DragonFly)
2011-02-12 18:22:14 +01:00
Guus Sliepen
f017c7f98f Add support for VDE through libvdeplug.
When compiled with vde/device.c, tinc will connect to a vde_switch instance
instead of using a tun/tap device.
2011-02-07 18:34:55 +01:00
Guus Sliepen
8d18cc6c4e Fix typo spotted by Andrew Scheller. 2011-01-29 10:49:44 +01:00
Guus Sliepen
b3731c0409 Proper check and dropin replacement for usleep(). 2011-01-12 20:57:14 +01:00
Guus Sliepen
4b8a599303 Update the NEWS. 2011-01-02 17:25:24 +01:00
Guus Sliepen
c228da54d4 Update the manual. 2011-01-02 17:25:03 +01:00
Guus Sliepen
4575c6c7df Document the behavior of "-n." 2011-01-02 17:24:23 +01:00
Guus Sliepen
6c05bf082b Remove unused variables. 2011-01-02 16:59:42 +01:00
Guus Sliepen
6a51d89cf7 Replace bogus #else with #endif.
Found by cppcheck, which complained about lenin not being initialized, but the
real problem is that reading packets would fail when using code compiled with
--tunemu on a normal tun device.
2011-01-02 16:55:42 +01:00
Guus Sliepen
d7636352ce Limit field width when scanning PID file.
Cppcheck warns that scanf() might otherwise crash when presented with a huge,
bogus PID file.
2011-01-02 16:52:36 +01:00
Guus Sliepen
3ce5e292da Close all filedescriptors in Solaris close_device(). 2011-01-02 16:50:24 +01:00
Guus Sliepen
f99661a4ca Always send MTU probes at least once every PingInterval.
Before, if MTU probes failed, tinc would stop sending probes until the next
time keys were regenerated (by default, once every hour).  Now it continues to
send them every PingInterval, so it recovers faster from temporary failures.
2011-01-02 15:02:23 +01:00
Guus Sliepen
cac0a5c651 Use setpriority() instead of nice() on UNIX-like systems.
The return value of nice() can not reliably indicate errors. The return value
of the setpriority() call is well-defined.
2010-11-20 14:31:11 +00:00
Guus Sliepen
d91903ef3c Attribution for Brandon Black. 2010-11-16 17:28:41 +01:00
Guus Sliepen
e764ff7be9 Fix variable length array declaration. 2010-11-16 16:45:36 +01:00
Guus Sliepen
5eb0440110 Free replay window when freeing a node_t. 2010-11-13 21:36:51 +01:00
Guus Sliepen
a9445e38f2 Fix warning message when setting SO_RCVBUF or SO_SNDBUF fails. 2010-11-13 21:34:59 +01:00