Commit graph

2066 commits

Author SHA1 Message Date
Guus Sliepen
eb80105ea8 Fix compiler warnings on OpenBSD. 2012-12-05 14:42:21 +01:00
Guus Sliepen
5e3607b616 Remove GraphDumpFile from the manual and manpages.
This option is not supported in tinc 1.1, "tincctl dump graph" can be used
instead.
2012-12-03 13:09:40 +01:00
Guus Sliepen
a717b9bcfb Add option to dump only a list of reachable nodes. 2012-12-03 13:08:03 +01:00
Guus Sliepen
75c619e372 More fixes for Windows.
In particular, Windows does support many of the timer* macros, except timeradd
and timersub.
2012-12-03 10:41:28 +01:00
Guus Sliepen
d53384c2de Fix compiler error on Windows. 2012-12-03 09:08:21 +01:00
Guus Sliepen
76816e119b Fix crash in timeout handling. 2012-12-03 09:07:23 +01:00
Guus Sliepen
d19b006065 Set a node's pointers to zero before trying to insert it into a tree. 2012-12-03 09:02:08 +01:00
Guus Sliepen
d2b19be1a0 Fix use of unitialised values in hash tables.
Not only was Valgrind unhappy about it, it could also result in cache misses.
2012-11-29 14:35:08 +01:00
Guus Sliepen
d9c70767aa Fix check for expired events.
This would trigger a infinite loop if a timeout expired and the next timeout
was not expired yet, but less than 1 second from being expired.
2012-11-29 14:32:12 +01:00
Guus Sliepen
8825cddd0d Allow multiple timeouts to expire at the exact same time. 2012-11-29 12:37:04 +01:00
Guus Sliepen
6bc5d626a8 Drop libevent and use our own event handling again.
There are several reasons for this:

- MacOS/X doesn't support polling the tap device using kqueue, requiring a
  workaround to fall back to select().
- On Windows only sockets are properly handled, therefore tinc uses a second
  thread that does a blocking ReadFile() on the TAP-Win32/64 device. However,
  this does not mix well with libevent.
- Libevent, event just the core, is quite large, and although it is easy to get
  and install on many platforms, it can be a burden.
- Libev is more lightweight and seems technically superior, but it doesn't
  abstract away all the platform differences (for example, async events are not
  supported on Windows).
2012-11-29 12:28:23 +01:00
Guus Sliepen
d30b9e1272 Ensure MTU probe replies are sent back the same way they came in.
Also sprinkle some comments over mtu_probe_h().
2012-11-19 14:20:50 +01:00
Guus Sliepen
3c1b704733 Improve UDP address selection.
We don't need to search the whole edge tree, we can use the node's own edge
tree since each edge has a pointer to its reverse. Also, we do need to make
sure we try the reflexive address often.
2012-11-19 13:50:17 +01:00
Guus Sliepen
f57129ce34 Try all known addresses of node during PMTU discovery, now also for SPTPS. 2012-11-17 22:48:06 +01:00
Guus Sliepen
30404650b2 Choose a suitable socket when updating a node's UDP address. 2012-11-17 22:14:52 +01:00
Guus Sliepen
8f9ee89522 Also don't use poll() on MacOS/X. 2012-11-15 11:24:18 +01:00
Guus Sliepen
8a77df9e28 Disable support for kqueue on MacOS/X.
Apparently MacOS/X doesn't support kqueue events on character devices.
2012-11-15 11:13:40 +01:00
Guus Sliepen
818c92e658 Remove text saying you must have one of PrivateKey or PrivateKeyFile in tinc.conf. 2012-11-14 10:44:35 +01:00
Guus Sliepen
e8bf81794f Send broadcast packets using a random socket, and properly support IPv6.
Before it would always use the first socket, and always send an IPv4 broadcast packet. That
works fine in a lot of situations, but it is better to try all sockets, and to send IPv6 packets
on IPv6 sockets. This is especially important for users that are on IPv6-only networks or that
have multiple physical network interfaces, although in the latter case it probably requires
them to use the ListenAddress variable to create a separate socket for each interface.
2012-11-13 15:05:41 +01:00
Guus Sliepen
0870c7c32c Don't take the address of a variable whose scope is about to disappear. 2012-11-13 15:01:43 +01:00
Guus Sliepen
bb3d7f3b31 Fix configure script help text for --enable options. 2012-11-11 19:01:28 +01:00
Guus Sliepen
5bfbb8f6c5 Fix index entry for section about readline library. 2012-11-11 19:01:02 +01:00
Guus Sliepen
5766518589 Mention in the manual that support for LZO and zlib can be disabled. 2012-11-11 18:53:23 +01:00
Guus Sliepen
6ec4596557 Mention libcurses and libreadline in the manual. 2012-11-11 18:45:40 +01:00
Guus Sliepen
0ee139e914 Make sure PMTU discovery works in switch mode with VLAN tags.
Before, when tinc saw a packet larger than the PMTU with a VLAN tag, it would
not know what to do with it, and would just forward it via TCP. Now, tinc
handles 802.1q packets correctly, as long as there is only one tag.
2012-11-10 23:55:56 +01:00
Guus Sliepen
ade4fccad6 Using alloca() for a constant sized buffer is very silly.
Cppcheck said using alloca() in the 21st century is silly anyway.
2012-11-10 23:13:05 +01:00
Guus Sliepen
b355476e91 Fix potential buffer overflow reading the PID file.
Found by cppcheck.
2012-11-10 23:09:31 +01:00
Guus Sliepen
edc08b73a9 Slightly randomize all timeouts. 2012-10-21 17:45:16 +02:00
Guus Sliepen
717ea66d7b Add the AutoConnect option.
When set to a non-zero value, tinc will try to maintain exactly that number of
meta connections to other nodes.  If there are not enough connections, it will
periodically try to set up an outgoing connection to a random node.  If there
are too many connections, it will periodically try to remove an outgoing
connection.
2012-10-21 17:35:13 +02:00
Guus Sliepen
1f8b70efa0 Keep track of the number of nodes in a tree. 2012-10-21 17:34:53 +02:00
Guus Sliepen
0006c754f2 Fix warnings from groff. 2012-10-17 13:51:02 +02:00
Guus Sliepen
0db9e471ea Releasing 1.1pre3. 2012-10-14 19:50:37 +02:00
Guus Sliepen
3254e75afe Fix a few compiler errors/warnings. 2012-10-14 19:21:13 +02:00
Guus Sliepen
70a1a5594a Update copyright notices. 2012-10-14 17:42:49 +02:00
Guus Sliepen
4200a378c4 Fix compile error on Windows. 2012-10-14 16:39:16 +02:00
Guus Sliepen
368727c3da tincctl: add node colors and edge weight to graph dump. 2012-10-14 16:12:17 +02:00
Guus Sliepen
40ed0c07dd Log more messages using logger(). 2012-10-14 15:37:24 +02:00
Guus Sliepen
b234304b66 Make sure the ReplayWindow option works for SPTPS as well. 2012-10-14 14:48:35 +02:00
Guus Sliepen
ee1d655f2f Only log success of initial datagram SPTPS handshake. 2012-10-14 14:45:27 +02:00
Guus Sliepen
44a24f63ac Fix handling of initial datagram SPTPS packet.
Only the very first packet of an SPTPS session should be send with REQ_KEY,
this signals the peer to abort any previous session and start a new one as
well.
2012-10-14 14:33:54 +02:00
Sven-Haegar Koch
ec1f7e525d sptps.c: Add missing newline to log message. 2012-10-12 17:19:56 +02:00
Guus Sliepen
94ec8d34db Strip newline from incoming SPTPS requests.
Most of the code doesn't care whether requests are terminated with a newline or
not, except that when requests are forwarded, it is assumed they do not have
one and a newline is added.  When a node using SPTPS receives a request from
another SPTPS-using node, and forwards it to a non-SPTPS-using node, this will
result in two consecutive newlines, which the latter node will see as an empty,
and thus invalid, request.
2012-10-11 22:47:13 +02:00
Guus Sliepen
45944e4514 Clear status and options fields of unreachable nodes. 2012-10-11 22:21:30 +02:00
Guus Sliepen
d917c8cb6b Fix whitespace. 2012-10-10 17:17:49 +02:00
Guus Sliepen
58f4b845b9 Try all known addresses of node during the PMTU discovery phase.
This helps in situations where some nodes have IPv6 and others have not.
2012-10-10 14:46:22 +02:00
Guus Sliepen
0ed0cc6f9c Fix hash functions for keys whose size is not divisible by 4. 2012-10-09 17:49:09 +02:00
Guus Sliepen
d1ec010660 Fix memory leaks found by valgrind. 2012-10-09 16:27:28 +02:00
Guus Sliepen
72642b40b3 Clear Ethernet header when reading packets from a tun device.
This fixes a warning from valgrind about uninitialized bytes, which were being
sent to other nodes.
2012-10-09 15:52:58 +02:00
Guus Sliepen
b346338f9c Remove unused variables, fix some #includes. 2012-10-09 13:28:09 +02:00
Guus Sliepen
f62b4a9134 Fix deleting connections from the connection list. 2012-10-09 13:23:12 +02:00