Guus Sliepen [Mon, 1 Mar 2010 22:35:02 +0000 (23:35 +0100)]
Simplify reading lines from configuration files.
Instead of allocating storage for each line read, we now read into fixed-size
buffers on the stack. This fixes a case where a malformed configuration file
could crash tinc.
Guus Sliepen [Sun, 28 Feb 2010 17:20:13 +0000 (18:20 +0100)]
Clamp MSS to miminum MTU in both directions.
Clamp MSS of both incoming and outgoing packets, and use the minimum of the
PMTU of both directions when clamping.
Timothy Redaelli [Wed, 10 Feb 2010 13:52:15 +0000 (14:52 +0100)]
Add --disable-zlib configure option
Timothy Redaelli [Wed, 10 Feb 2010 12:24:33 +0000 (13:24 +0100)]
Add --disable-lzo configure option
Guus Sliepen [Wed, 3 Feb 2010 21:49:48 +0000 (22:49 +0100)]
Releasing 1.0.12.
Guus Sliepen [Wed, 3 Feb 2010 10:18:46 +0000 (11:18 +0100)]
Ensure peers with a meta connection always have our key.
This keeps UDP probes going, which in turn keeps NAT mappings alive.
Guus Sliepen [Tue, 2 Feb 2010 21:49:21 +0000 (22:49 +0100)]
Update copyright notices.
Guus Sliepen [Tue, 2 Feb 2010 21:22:27 +0000 (22:22 +0100)]
Try to set DF bit on BSDs as well.
Every operating system seems to have its own, slightly different way to disable
packet fragmentation. Emit a compiler warning when no suitable way is found.
On OpenBSD, it seems impossible to do it for IPv4.
Guus Sliepen [Tue, 2 Feb 2010 00:02:40 +0000 (01:02 +0100)]
Immediately exchange keys when establishing a meta connection.
This in turn will trigger PMTU discovery, and ensures nodes know each others
reflexive UDP address and port.
Guus Sliepen [Mon, 1 Feb 2010 23:51:44 +0000 (00:51 +0100)]
Determine peer's reflexive address and port when exchanging keys.
To help peers that are behind NAT connect to each other directly via UDP, they
need to know the exact external address and port that they use. Keys exchanged
between NATted peers necessarily go via a third node, which knows this address
and port, and can append this information to the keys, which is in turned used
by the peers.
Since PMTU discovery will immediately trigger UDP communication from both sides
to each other, this should allow direct communication between peers behind
full, address-restricted and port-restricted cone NAT.
Guus Sliepen [Sat, 23 Jan 2010 17:48:01 +0000 (18:48 +0100)]
Be liberal in accepting KEY_CHANGED/REQ_KEY/ANS_KEY requests.
When we got a key request for or from a node we don't know, we disconnected the
node that forwarded us that request. However, especially in TunnelServer mode,
disconnecting does not help. We now ignore such requests, but since there is no
way of telling the original sender that the request was dropped, we now retry
sending REQ_KEY requests when we don't get an ANS_KEY back.
Guus Sliepen [Fri, 22 Jan 2010 20:59:40 +0000 (21:59 +0100)]
Run subnet-up/down scripts for local MAC addresses as well.
Guus Sliepen [Fri, 22 Jan 2010 20:47:26 +0000 (21:47 +0100)]
Fix subnet-up/down scripts being called with an empty SUBNET.
Commit
052ff8b2c598358d1c5febaa9f9f5fc5d384cfd3 contained a bug that causes
scripts to be called with an empty, or possibly corrupted SUBNET variable when
a Subnet is added or removed while the owner is still online. In router mode,
this normally does not happen, but in switch mode this is normal.
Guus Sliepen [Sat, 16 Jan 2010 19:16:33 +0000 (20:16 +0100)]
Make MSS clamping configurable, but enabled by default.
It can either be set globally in tinc.conf, or per-node in host config files.
Guus Sliepen [Sat, 16 Jan 2010 18:32:33 +0000 (19:32 +0100)]
Also clamp MSS of TCP over IPv6 packets.
Guus Sliepen [Fri, 15 Jan 2010 22:41:14 +0000 (23:41 +0100)]
Optimise handling of select() returning <= 0.
Before, we immediately retried select() if it returned -1 and errno is EAGAIN
or EINTR, and if it returned 0 it would check for network events even if we
know there are none. Now, if -1 or 0 is returned we skip checking network
events, but we do check for timer and signal events.
Guus Sliepen [Fri, 15 Jan 2010 22:19:08 +0000 (23:19 +0100)]
Ping nodes immediately when receiving SIGALRM.
One reason to send the ALRM signal is to let tinc immediately try to connect to
outgoing nodes, for example when PPP or DHCP configuration of the outgoing
interface finished. Conversely, when the outgoing interface goes down one can
now send this signal to let tinc quickly detect that links are down too.
Guus Sliepen [Fri, 15 Jan 2010 12:42:37 +0000 (13:42 +0100)]
Clamp MSS of IPv4 SYN packets.
Some ISPs block the ICMP Fragmentation Needed packets that tinc sends. We
clamp the MSS of IPv4 SYN packets to prevent hosts behind those ISPs from
sending too large packets.
Guus Sliepen [Thu, 24 Dec 2009 11:42:21 +0000 (12:42 +0100)]
Allow Port and PMTUDiscovery options in tinc.conf, always enable PMTUDiscovery by default.
Guus Sliepen [Wed, 23 Dec 2009 18:51:55 +0000 (19:51 +0100)]
Use xstrdup() instead of xasprintf() to copy static strings.
Guus Sliepen [Wed, 23 Dec 2009 18:49:38 +0000 (19:49 +0100)]
Allow port to be specified in Address statements.
This allows one to connect to use more than one port number to connect to
another node. The syntax is now:
Address = <hostname> [<port>]
Guus Sliepen [Wed, 23 Dec 2009 18:22:06 +0000 (19:22 +0100)]
Do not fragment packets smaller than RFC defined minimum MTUs.
For IPv6, the minimum MTU is 1280 (RFC 2460), for IPv4 the minimum is actually
68, but this is such a low limit that it will probably hurt performance, so we
do as if it is 576 (the minimum packet size hosts should be able to handle, RFC
791). If we detect a path MTU smaller than those minima, and we have to handle
a packet that is bigger than the PMTU but smaller than those minima, we forward
them via TCP instead of fragmenting or returning ICMP packets.
Guus Sliepen [Tue, 8 Dec 2009 22:18:37 +0000 (22:18 +0000)]
Forget addresses of unreachable nodes.
We clear the cached address used for UDP connections when a node becomes
unreachable. This also prevents host-up scripts from passing the old, cached
address from when the host becomes reachable again from a different address.
Guus Sliepen [Sat, 28 Nov 2009 11:56:13 +0000 (11:56 +0000)]
Remove unused variable in lookup_subnet_*() functions.
Guus Sliepen [Sat, 28 Nov 2009 11:52:23 +0000 (11:52 +0000)]
When learning MAC addresses, only check our own Subnets for previous entries.
Before it would check all addresses, and not learn an address if another node
already claimed that address. This caused fast roaming to fail, the code from
commit
6f6f426b353596edca77829c0477268fc2fc1925 was never triggered.
Guus Sliepen [Sun, 1 Nov 2009 15:24:39 +0000 (16:24 +0100)]
Releasing 1.0.11.
Guus Sliepen [Sun, 1 Nov 2009 14:57:28 +0000 (15:57 +0100)]
Start a tinc service if it already exists.
Guus Sliepen [Tue, 27 Oct 2009 22:53:49 +0000 (23:53 +0100)]
Fast handoff of roaming MAC addresses.
In switch mode, if a known MAC address is claimed by a second node before it
expired at the first node, it is likely that this is because a computer has
roamed from the LAN of the first node to that of the second node. To ensure
packets for that computer are routed to the second node, the first node should
delete its corresponding Subnet as soon as possible, without waiting for the
normal expiry timeout.
Guus Sliepen [Sat, 24 Oct 2009 23:40:07 +0000 (01:40 +0200)]
Move socket error interpretation to utils.h.
Guus Sliepen [Sat, 24 Oct 2009 22:50:09 +0000 (00:50 +0200)]
Use WSAGetLastError() to determine cause of network errors on Windows.
This reduces log spam and lets path MTU discovery work faster.
Michael Tokarev [Sun, 18 Oct 2009 17:27:24 +0000 (21:27 +0400)]
Remove localedir leftovers.
Guus Sliepen [Sat, 24 Oct 2009 20:32:35 +0000 (22:32 +0200)]
Use IP_DONTFRAGMENT instead of IP_MTU_DISCOVER on Windows.
This ensures the DF bit on outgoing UDP packets gets set on Windows when path
MTU discovery is enabled, reducing fragmentation.
Guus Sliepen [Sat, 24 Oct 2009 19:53:01 +0000 (21:53 +0200)]
Forward packets to not directly reachable hosts via UDP if possible.
If MTU probing discovered a node was not reachable via UDP, packets for it were
forwarded to the next hop, but always via TCP, even if the next hop was
reachable via UDP. This is now fixed by retrying to send the packet using
send_packet() if the destination is not the same as the nexthop.
Guus Sliepen [Sat, 24 Oct 2009 19:35:40 +0000 (21:35 +0200)]
Make maxmtu equal to minmtu when fixing the path MTU to a node.
This ensures MTU probes used to ping nodes are not too large, and prevents
restarting MTU probing unnecessarily.
Guus Sliepen [Sat, 24 Oct 2009 19:32:06 +0000 (21:32 +0200)]
Always reply to MTU probes via UDP.
It could sometime happen that a node would return MTU probes via TCP, which
does not make a lot of sense.
Guus Sliepen [Sat, 24 Oct 2009 18:54:44 +0000 (20:54 +0200)]
Allow UDP packets with an address different from the corresponding TCP connection.
Guus Sliepen [Sat, 24 Oct 2009 14:15:24 +0000 (16:15 +0200)]
Use uint32_t instead of long int for connection options.
Options should have a fixed width anyway, but this also fixes a possible MinGW
compiler bug where %lx tries to print a 64 bit value, even though a long int is
only 32 bits.
Guus Sliepen [Sat, 24 Oct 2009 14:05:12 +0000 (16:05 +0200)]
Add dummy device.
Guus Sliepen [Tue, 20 Oct 2009 20:39:07 +0000 (22:39 +0200)]
Clarify and increase level of log message about MTU probes to unreachable nodes.
Guus Sliepen [Tue, 20 Oct 2009 20:33:16 +0000 (22:33 +0200)]
Handle weighted Subnets in switch and hub modes.
We now handle MAC Subnets in exactly the same way as IPv4 and IPv6 Subnets.
This also fixes a problem that causes unncessary broadcasting of unicast
packets in VPNs where some daemons run 1.0.10 and some run other versions.
Guus Sliepen [Tue, 20 Oct 2009 20:22:59 +0000 (22:22 +0200)]
Starting to work towards 1.0.11.
Guus Sliepen [Tue, 20 Oct 2009 20:14:47 +0000 (22:14 +0200)]
Fix a possible crash when sending the HUP signal.
When the HUP signal is sent while some outgoing connections have not been made
yet, or are being retried, a NULL pointer could be dereferenced resulting in
tinc crashing. We fix this by more careful handling of outgoing_ts, and by
deleting all connections that have not been fully activated yet at the HUP
signal is received.
Guus Sliepen [Sun, 18 Oct 2009 14:45:13 +0000 (16:45 +0200)]
Releasing 1.0.10.
Guus Sliepen [Sun, 18 Oct 2009 14:44:32 +0000 (16:44 +0200)]
Fix description of the WEIGHT environment variable.
Guus Sliepen [Sun, 18 Oct 2009 12:22:20 +0000 (14:22 +0200)]
Include missing header.
Guus Sliepen [Mon, 12 Oct 2009 21:51:57 +0000 (23:51 +0200)]
Remove debugging message when reading packets from a BSD device.
This was inadvertently introduced by commit
4a5d42178cc0954efba8b24058da9c70cc77c35a.
Guus Sliepen [Mon, 12 Oct 2009 20:14:47 +0000 (22:14 +0200)]
Allow the cloning /dev/tap interface to be used on FreeBSD and NetBSD.
This device works like /dev/tun on Linux, automatically creating a new tap
interface when a program opens it. We now pass the actual name of the newly
created interface in $INTERFACE.
Guus Sliepen [Sun, 11 Oct 2009 16:57:58 +0000 (18:57 +0200)]
Use MTU probes to regularly ping other nodes over UDP.
This keeps NAT mappings for UDP alive, and will also detect when a node is not
reachable via UDP anymore or if the path MTU is decreasing. Tinc will fall back
to TCP if the node has become unreachable.
If UDP communication is impossible, we stop sending probes, but we retry if it
changes its keys.
We also decouple the UDP and TCP ping mechanisms completely, to ensure tinc
properly detects failure of either method.
Guus Sliepen [Sun, 11 Oct 2009 13:46:52 +0000 (15:46 +0200)]
Small updates to the documentation.
Mention that TCPOnly is not necessary anymore since tinc will autodetect
whether it can send via UDP or not. Also mention the WEIGHT environment
variable and the new default value (2048 bits) of RSA keys.
Guus Sliepen [Sun, 11 Oct 2009 12:20:14 +0000 (14:20 +0200)]
Ensure that the texinfo manual can be converted to HTML.
The top node was made conditional with the @iftex command, since it should not
appear in PostScript and PDF output. However, it is still necessary for
texi2html, so we have to use @ifnottex instead.
Texi2html also complains about the use of @cindex in the copyright statement,
so we remove that.
Guus Sliepen [Sun, 11 Oct 2009 11:56:04 +0000 (13:56 +0200)]
Revert "Raise default crypto algorithms to AES256 and SHA256."
Although it would be better to have the new defaults, only the most recent
releases of most of the platforms supported by tinc come with a version of
OpenSSL that supports SHA256. To ensure people can compile tinc and that nodes
can interact with each other, we revert the default back to Blowfish and SHA1.
This reverts commit
4bb3793e38b7c7f24dd308801e7f6dbb02cf02d2.
Guus Sliepen [Sun, 11 Oct 2009 11:54:05 +0000 (13:54 +0200)]
Remove code duplication when checking ADD_EDGE/DEL_EDGE messages.
Guus Sliepen [Sun, 11 Oct 2009 11:51:10 +0000 (13:51 +0200)]
Don't disconnect clients in TunnelServer mode who send unauthorised ADD_SUBNETs.
So that we are liberal in what we accept.
Borg [Sat, 3 Oct 2009 11:06:00 +0000 (13:06 +0200)]
Removed last gettext function.
Guus Sliepen [Tue, 29 Sep 2009 14:25:20 +0000 (16:25 +0200)]
Remove autogenerated files from EXTRA_DIST.
Apparently they were once necessary, but autoconf now includes them
automatically. Some of them are not used anymore, and this caused make dist to
fail.
Guus Sliepen [Sat, 26 Sep 2009 10:51:52 +0000 (12:51 +0200)]
Update the NEWS.
Guus Sliepen [Fri, 25 Sep 2009 19:14:56 +0000 (21:14 +0200)]
Add more authors to the copyright headers.
Git's log and blame tools were used to find out which files had significant
contributions from authors who sent in patches that were applied before we used
git.
Guus Sliepen [Thu, 24 Sep 2009 22:54:07 +0000 (00:54 +0200)]
Drop support for localisation.
Localised messages don't make much sense for a daemon, and there is only the
Dutch translation which costs time to maintain.
Guus Sliepen [Thu, 24 Sep 2009 22:33:04 +0000 (00:33 +0200)]
Remove checkpoint tracing.
This feature is not necessary anymore since we have tools like valgrind today
that can catch stack overflow errors before they make a backtrace in gdb
impossible.
Guus Sliepen [Thu, 24 Sep 2009 22:14:03 +0000 (00:14 +0200)]
K&R style braces.
This is essentially commit
f02d3ed3e135b5326003e7f69f8331ff6a3cc219 from the
1.1 branch, making it easier to merge between master and 1.1.
Guus Sliepen [Thu, 24 Sep 2009 22:01:00 +0000 (00:01 +0200)]
Update the address of the Free Software Foundation in all copyright headers.
Guus Sliepen [Thu, 24 Sep 2009 21:42:30 +0000 (23:42 +0200)]
Remove Ivo's old email addresses.
Guus Sliepen [Thu, 24 Sep 2009 21:39:16 +0000 (23:39 +0200)]
Remove all occurences of $Id$.
Guus Sliepen [Thu, 24 Sep 2009 21:29:46 +0000 (23:29 +0200)]
Update copyright information.
- Update year numbers in copyright headers.
- Add copyright information for Michael Tokarev and Florian Forster to the
copyright headers of files to which they have contributed significantly.
- Mention Michael and Florian in AUTHORS.
- Mention that tinc is GPLv3 or later if compiled with the --enable-tunemu
flag.
Guus Sliepen [Tue, 15 Sep 2009 21:22:13 +0000 (23:22 +0200)]
Send large packets we cannot handle properly via TCP.
During the path MTU discovery phase, we might not know the maximum MTU yet, but
we do know a safe minimum. If we encounter a packet that is larger than that
the minimum, we now send it via TCP instead to ensure it arrives. We also
allow large packets that we cannot fragment or create ICMP replies for to be
sent via TCP.
Guus Sliepen [Tue, 15 Sep 2009 21:04:52 +0000 (23:04 +0200)]
Raise default RSA key length to 2048 bits.
Guus Sliepen [Tue, 15 Sep 2009 20:59:01 +0000 (22:59 +0200)]
Use a mutex to allow the TAP reader to process packets faster on Windows.
The TAP-Win32 device is not a socket, and select() under Windows only works
with sockets. Tinc used a separate thread to read from the TAP-Win32 device,
and passed this via a local socket to the main thread which could then select()
from it. We now use a global mutex, which is only unlocked when the main thread
is waiting for select(), to allow the TAP reader thread to process packets
directly.
Guus Sliepen [Tue, 15 Sep 2009 20:58:16 +0000 (22:58 +0200)]
Remove extra {.
Guus Sliepen [Tue, 15 Sep 2009 10:08:05 +0000 (12:08 +0200)]
Raise default crypto algorithms to AES256 and SHA256.
In light of the recent improvements of attacks on SHA1, the default hash
algorithm in tinc is now SHA256. At the same time, the default symmetric
encryption algorithm has been changed to AES256.
Guus Sliepen [Mon, 14 Sep 2009 22:36:07 +0000 (00:36 +0200)]
Use access() instead of stat() for checking whether scripts exist.
Guus Sliepen [Mon, 14 Sep 2009 22:28:20 +0000 (00:28 +0200)]
Remove dropin random() function, as it is not used anymore.
Guus Sliepen [Mon, 14 Sep 2009 22:24:31 +0000 (00:24 +0200)]
Allow compiling for Windows XP and higher.
This allows us to use getaddrinfo(), getnameinfo() and related functions, which
allow tinc to make connections over existing IPv6 networks. These functions are
not available on Windows 2000 however. By default, support is enabled, but when
compiling for Windows 2000 the configure switch --with-windows2000 should be
used.
Since getaddrinfo() et al. are not functions but macros on Windows, we have to
use AC_CHECK_DECLS() instead of AC_CHECK_FUNCS() in configure.in.
Guus Sliepen [Mon, 14 Sep 2009 21:28:28 +0000 (23:28 +0200)]
Also do not use drand48(), it is not available on Windows.
Guus Sliepen [Mon, 14 Sep 2009 21:06:00 +0000 (23:06 +0200)]
Use only rand(), not random().
We used both rand() and random() in our code. Since it returns an int, we have
to use %x in our format strings instead of %lx. This fixes a crash under
Windows when cross-compiling tinc with a recent version of MinGW.
Guus Sliepen [Sun, 13 Sep 2009 12:08:59 +0000 (14:08 +0200)]
Apparently it's impolite to ask GCC to subtract two pointers.
If two pointers do not belong to the same array, pointer subtraction gives
nonsensical results, depending on the level of optimisation and the
architecture one is compiling for. It is apparently not just subtracting the
pointer values and dividing by the size of the object, but uses some kind of
higher magic not intended for mere mortals. GCC will not warn about this at
all. Casting to void * is also a no-no, because then GCC does warn that strict
aliasing rules are being broken. The only safe way to query the ordering of two
pointers is to use the (in)equality operators.
The unsafe implementation of connection_compare() has probably caused the "old
connection_t for ... still lingering" messages. Our implementation of AVL trees
is augmented with a doubly linked list, which is normally what is traversed.
Only when deleting an old connection the tree itself is traversed.
Guus Sliepen [Sun, 13 Sep 2009 12:07:40 +0000 (14:07 +0200)]
Remove superfluous call to avl_delete().
Guus Sliepen [Sat, 12 Sep 2009 12:19:36 +0000 (14:19 +0200)]
Handle unicast packets larger than PMTU in switch mode.
If PMTUDiscovery is enabled, and we see a unicast packet that is larger than
the path MTU in switch mode, treat it just like we would do in router mode.
Guus Sliepen [Sat, 12 Sep 2009 11:40:32 +0000 (13:40 +0200)]
Allow PMTUDiscovery in switch and hub modes again.
PMTUDiscovery was disabled in commit
d5b56bbba56480b5565ffb38496175a7c1df60ac
because tinc did not handle packets larger than the path MTU in switch and hub
modes. We now allow it again in preparation of proper support, but default to
off.
Guus Sliepen [Sat, 12 Sep 2009 11:34:11 +0000 (13:34 +0200)]
Put Subnet weight in a separate environment variable.
Commit
5674bba5c54c1aee3a4ac5b3aba6b3ebded91bbc introduced weighted Subnets,
but the weight was included in the SUBNET variable passed to subnet-up/down
scripts. This makes it harder to use in those scripts. The weight is now
stripped from the SUBNET variable and put in the WEIGHT variabel.
Guus Sliepen [Thu, 10 Sep 2009 17:51:08 +0000 (19:51 +0200)]
Don't stat() on iPhone/iPod.
Grzegorz Dymarek noted that tinc segfaults at the stat() call in
execute_script() on the iPhone. We can omit the stat() call for the moment,
the subsequent call to system() will fail with just a warning.
Guus Sliepen [Thu, 10 Sep 2009 17:32:54 +0000 (19:32 +0200)]
Add support for iPhones and recent iPods.
This is a slightly modified patch from Grzegorz Dymarek that allows tinc to use
the tunemu device, which allows tinc to be compiled for iPhones and recent
iPods. To enable support for tunemu, the --enable-tunemu option has to be used
when running the configure script.
Guus Sliepen [Wed, 9 Sep 2009 12:51:36 +0000 (14:51 +0200)]
Another safe bitfield conversion.
Guus Sliepen [Wed, 9 Sep 2009 11:23:16 +0000 (13:23 +0200)]
Add the GPL license to the repository.
Tinc is licensed under the GPL version 2 or later. To ensure autoconf does not
install the wrong license if COPYING is missing, we have to put the right one
in place.
Guus Sliepen [Wed, 9 Sep 2009 10:04:08 +0000 (12:04 +0200)]
Convert bitfields to integers in a safe way.
This is commit
eb391c52eed46f3f03b404553df417851fc0cb90 redone, but without the
non-standard anonymous union.
Guus Sliepen [Tue, 8 Sep 2009 19:45:24 +0000 (21:45 +0200)]
Ensure tinc compiles with gcc -std=c99.
We use a lot of C99 features already, but also some extensions which are not in
the standard.
Guus Sliepen [Tue, 8 Sep 2009 16:21:52 +0000 (18:21 +0200)]
UNIX signal numbers start at 1.
Guus Sliepen [Tue, 8 Sep 2009 16:18:36 +0000 (18:18 +0200)]
Replace asprintf() by xasprintf().
Guus Sliepen [Tue, 8 Sep 2009 16:18:16 +0000 (18:18 +0200)]
Check the return value of fscanf() when reading a PID file.
Guus Sliepen [Tue, 8 Sep 2009 16:16:58 +0000 (18:16 +0200)]
Add xasprintf() and xvasprintf().
These functions wrap asprintf() and vasprintf(), and check the return value. If
the function failed, tinc will exit with an error message, similar to xmalloc()
and friends.
Michael Tokarev [Sat, 5 Sep 2009 13:24:41 +0000 (17:24 +0400)]
Remove extra semicolon in my definition of setpriority()
Guus Sliepen [Tue, 8 Sep 2009 14:35:28 +0000 (16:35 +0200)]
Always remove a node from the UDP tree before freeing it.
Valgrind caught tinc reading free'd memory during a purge(). This was caused by
first removing it from the main node tree, which will already call free_node(),
and then removing it from the UDP tree. This might cause spurious segmentation
faults.
Guus Sliepen [Thu, 11 Jun 2009 17:39:25 +0000 (19:39 +0200)]
Change level of some debug messages, zero pointer after freeing hostname.
Guus Sliepen [Thu, 11 Jun 2009 17:26:34 +0000 (19:26 +0200)]
Do not log errors when recvfrom() returns EAGAIN or EINTR.
Although we select() before we call recvfrom(), it sometimes happens that
select() tells us we can read but a subsequent read fails anyway. This is
harmless.
Guus Sliepen [Thu, 11 Jun 2009 17:07:54 +0000 (19:07 +0200)]
Remove pending MTU probe events when a node's reachability status changes.
Guus Sliepen [Thu, 11 Jun 2009 16:36:08 +0000 (18:36 +0200)]
Don't try to send MTU probes to unreachable nodes.
If there is an outstanding MTU probe event for a node which is not reachable
anymore, a UDP packet would be sent to that node, which caused a key request to
be sent to that node, which triggered a NULL pointer dereference. Probes and
other UDP packets to unreachable nodes are now dropped.
Guus Sliepen [Fri, 5 Jun 2009 14:14:31 +0000 (16:14 +0200)]
Properly set HMAC length for incoming packets.
Michael Tokarev [Fri, 5 Jun 2009 09:33:58 +0000 (13:33 +0400)]
try outgoing connections before chroot/drop_privs
When chrooted, we either need to force-initialize resolver
and/or nsswitch somehow (no clean way) or resolve all the
names we want before entering chroot jail. The latter
looks cleaner, easier and it is actually safe because
we still don't talk with the remote nodes there, only
initiating outgoing connections.
Michael Tokarev [Fri, 5 Jun 2009 07:58:17 +0000 (11:58 +0400)]
cleanup setpriority thing to make it readable
Guus Sliepen [Thu, 28 May 2009 21:18:22 +0000 (23:18 +0200)]
Add some const where appropriate.
Guus Sliepen [Thu, 28 May 2009 20:51:30 +0000 (22:51 +0200)]
Add ProcessPriority option.
This option can be set to low, normal or high. On UNIX flavours, this changes
the nice value of the process by +10, 0 and -10 respectively. On Windows, it
sets the priority to BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS and
HIGH_PRIORITY_CLASS respectively.
A high priority might help to reduce latency and packet loss on the VPN.