Don't use SOL_IP and SOL_IPV6. These macros do not exist on all platforms, instead one should use IPPROTO_IP and IPPROTO_IPV6. This fixes a bug on macOS where the IPV6_V6ONLY flag would not be applied and could result in IPv4 sockets not working.
Fix all -Wall -W compiler warnings.
Reformat all code using astyle.
Convert sizeof foo to sizeof(foo). While technically sizeof is an operator and doesn't need the parentheses around expressions it operates on, except if they are type names, code formatters don't seem to handle this very well.
Log warnings about dropped packets only with debug level 5 or higher.
Ensure compatibility with OpenSSL 1.1.0.
Get rid of a warning when compiling tinc using MinGW. Because Windows has the wrong declaration of setsockopt().
Update copyright notices.
Fix warnings from the Clang Static Analyzer. These were all harmless.
Remember ToS/Diffserv priority for each socket individually.
Support ToS/DiffServ priority handling for IPv6 meta and UDP connections.
Releasing 1.0.24.
Use constant time memcmp() when comparing packet HMACs. This eliminates a timing side channel vulnerability, which could potentially allow an attacker to compute a valid HMAC, and insert arbitrary ciphertext data into the connection. If an attacker also identifies packets with a plaintext it can guess (e.g. small packets every 1s are probably pings), the attacker can xor the ciphertext to mangle the packet to arbitrary plaintext. Although this type of attack is rarely seen in the wild, it is generally considered technically viable. Signed-off-by: Steffan Karger <steffan@karger.me>
Remove useless variable 'hard' from try_harder().
Don't echo broadcast packets back when Broadcast = direct.
Drop packets forwarded via TCP if they are too big (CVE-2013-1428). Normally all requests sent via the meta connections are checked so that they cannot be larger than the input buffer. However, when packets are forwarded via meta connections, they are copied into a packet buffer without checking whether it fits into it. Since the packet buffer is allocated on the stack, this in effect allows an authenticated remote node to cause a stack overflow. This issue was found by Martin Schobert.
Releasing 1.0.20.
Detect increases in PMTU. Tinc never restarts PMTU discovery unless a node becomes unreachable. However, it can be that the PMTU was very low during the initial discovery, but has increased later. To detect this, tinc now tries to send an extra packet every PingInterval, with a size slightly higher than the currently known PMTU. If this packet is succesfully received back, we partially restart PMTU discovery to find out the new maximum.
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. Conflicts: src/net_packet.c
Don't take the address of a variable whose scope is about to disappear. Conflicts: src/net_packet.c