Commit graph

1548 commits

Author SHA1 Message Date
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
Brandon L Black
0d61d4ae13 Improved handling of queue-jumping packets on receive 2010-11-13 21:25:48 +01:00
Brandon L Black
23acc19bc0 Configurable ReplayWindow size, zero disables 2010-11-13 21:25:46 +01:00
Brandon L Black
8dfe1b374e Configurable SO_RCVBUF/SO_SNDBUF for the UDP socket 2010-11-13 21:25:44 +01:00
Brandon L Black
3f410e2f8f Experimental IFF_ONE_QUEUE support for Linux 2010-11-13 21:25:41 +01:00
Guus Sliepen
9e3ca39773 Use variable length arrays instead of alloca(). 2010-11-13 15:55:38 +01:00
Guus Sliepen
e2e6ec8050 Provide usleep() for Windows. 2010-11-13 15:50:39 +01:00
Guus Sliepen
930bf74fbe Don't use strlen() on a NULL pointer.
A bug introduced in commit 667b1bac77 caused tinc
to crash on startup.
2010-11-12 11:38:05 +01:00
Guus Sliepen
a07aa92176 Add short options -R and -U to the tincd(8) manpage. 2010-11-12 11:33:01 +01:00
Guus Sliepen
66b7aea294 Read error counter must be static. 2010-11-02 14:23:43 +01:00
Guus Sliepen
a91bf2dfcd Quit when there are too many consecutive errors on the tun/tap device.
Although transient errors sometimes happen on the tun/tap device (for example,
if the kernel is temporarily out of buffer space), there are situations where
the tun/tap device becomes permanently broken. Instead of endlessly spamming
the syslog, we now sleep an increasing amount of time between consecutive read
errors, and if reads still fail after 10 attempts (approximately 3 seconds),
tinc will quit.
2010-11-02 14:18:35 +01:00
Michael Tokarev
aca70cd3c3 Treat netname="." in a special way.
Treat netname "." in a special way as if there was no netname
specified.  Before, f.e. tincd -n. -k didn't work as it tried
to open /var/run/tinc-.pid.  Now -n. works as if there was no
-n option is specified.

Signed-Off-By: Michael Tokarev <mjt@tls.msk.ru>
2010-10-24 13:32:36 +02:00
Guus Sliepen
5f729f76f5 Remove unused variables.
These were caused by commit 667b1bac77.
2010-10-22 22:46:44 +02:00
Guus Sliepen
20ae7dd8c1 Abort disabling old PEM keys on I/O errors. 2010-10-22 22:43:50 +02:00
Guus Sliepen
a08462bf84 Ensure there is a newline character before a PEM key is written. 2010-10-22 22:42:21 +02:00
Guus Sliepen
c6ccbadfcf Attribution for Timothy Redaelli. 2010-10-22 13:40:04 +02:00
Guus Sliepen
1c2cd7ed27 Attribution for Julien Muchembled. 2010-10-22 13:17:42 +02:00
Guus Sliepen
667b1bac77 Remove duplicate command-line option parsing.
Also fix parsing of command-line host configuration options for the local node.
2010-10-22 13:06:06 +02:00
Guus Sliepen
ff71f28902 Merge local host configuration with server configuration.
With some exceptions, tinc only accepted host configuration options for the
local node from the corresponding host configuration file. Although this is
documented, many people expect that they can also put those options in
tinc.conf. Tinc now internally merges the contents of both tinc.conf and the
local host configuration file.
2010-10-22 12:47:12 +02:00
Julien Muchembled
8c3105283a New '-o' option to configure server or hosts from command line
Options given on the command line have precedence over configuration from files.

This can be useful, for example, for a roaming node, for which 'ConnectTo' and
<host>.Address depends on its location.
2010-09-05 22:26:26 +02:00
Guus Sliepen
4b6a9f1c1f Do not append an address to ANS_KEY messages if we don't know any address.
This would let tinc raise an exception when an ANS_KEY request crossed a
DEL_EDGE request for the node sending the key.
2010-06-04 16:03:19 +02:00
Guus Sliepen
798fa2f04c Use 64 bit counters to keep track of bytes sent/received from the virtual network interface. 2010-06-04 15:04:08 +02:00
Guus Sliepen
4a21aabada Detect and prevent two nodes with the same Name being on the VPN simultaneously.
In this situation, the two nodes will start fighting over the edges they announced.
When we have to contradict both ADD_EDGE and DEL_EDGE messages, we log a warning,
and with 25% chance per PingTimeout we quit.
2010-06-04 14:53:52 +02:00
Guus Sliepen
dbf3d168b7 Use strrchr() insteaad of rindex().
The latter function is deprecated, some build environments do not support.
2010-05-07 12:24:49 +02:00
Timothy Redaelli
eda7179874 Fix warnings under BSD 2010-05-06 21:19:49 +02:00
Timothy Redaelli
df985256a7 Fix warnings showed using -D_FORTIFY_SOURCE=2 2010-05-04 00:54:37 +02:00
Guus Sliepen
f5122ccece Fix all warnings when compiling with mingw64. 2010-05-01 15:39:59 +02:00
Guus Sliepen
ef92a5725c OpenSSL 1.0.0 compiled for 64 bit Windows requires linking with -lcrypt32. 2010-05-01 15:39:03 +02:00
Guus Sliepen
0fdd7da520 Use intptr_t instead of long to store a pointer. 2010-05-01 15:38:04 +02:00
Guus Sliepen
c94ede3b87 Define WINVER before including any other header file on Windows. 2010-05-01 15:37:11 +02:00
Guus Sliepen
4766359e14 Fix reading configuration files that do not end with a newline. Again. 2010-04-17 12:01:38 +02:00
Guus Sliepen
26b8cf8680 Releasing 1.0.13. 2010-04-11 20:40:20 +02:00
Guus Sliepen
74653beb5b Mark Forwarding and DirectOnly options as being experimental. 2010-04-11 19:47:44 +02:00
Guus Sliepen
0ddce6370d Don't redefine MAX if it already exists. 2010-04-11 19:39:31 +02:00
Guus Sliepen
a9bbb3357a Fixes for definitions under Windows. 2010-04-11 19:20:02 +02:00
Guus Sliepen
4708f2c89e Ensure subnet-up/down scripts are called after HUP when necessary. 2010-04-11 18:34:50 +02:00
Guus Sliepen
32f5524c4b Fix reloading Subnets when StrictSubnets is set. 2010-04-11 04:35:16 +02:00
Guus Sliepen
9f53ab209d Reload Subnets when getting a HUP signal and StrictSubnets is used. 2010-04-11 00:50:42 +02:00
Guus Sliepen
d1cc637470 Ensure ICMP_NET_ANO is defined. 2010-04-10 23:55:15 +02:00
Guus Sliepen
f75e71bc69 Convert Port to numeric form before sending it to other nodes.
If one uses a symbolic name for the Port option, tinc will send that name
literally to other nodes.  However, it is not guaranteed that all nodes have
the same contents in /etc/services, or have such a file at all.
2010-04-03 09:46:45 +01:00
Sven-Haegar Koch
292354912f Never delete Subnets when StrictSubnets is set
If a node is unreachable, and not connected to an edge anymore, it gets
deleted. When this happens its subnets are also removed, which should
not happen with StrictSubnets=yes.

Solution:
- do not remove subnets in src/net.c::purge(), we know that all subnets
  in the list came from our hosts files.
  I think here you got the check wrong by looking at the tunnelserver
  code below it - with strictsubnets we still inform others but do not
  remove the subnet from our data.
- do not remove nodes in net.c::purge() that still have subnets
  attached.
2010-03-18 11:50:45 +01:00
Guus Sliepen
146760bd35 Fix typo. 2010-03-10 16:07:01 +01:00