Fix segfault when dest->mtu is 0.
Fix spelling errors. Found by codespell.
Fix all warnings when compiling with -Wall -W -pedantic.
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.
Releasing 1.0.32.
route: Support ToS/DiffServ priority inheritance when routing IPv6 packets. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
Update copyright notices.
Remove forward declaration for do_decrement_ttl. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
s/broadcast_packet_helper/route_broadcast/ Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
Fix DecrementTTL option for packets destined to the local node. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
Fix invalid checksum generation. Use equation 3 given in RFC 1624 and the UpdateTTL() example function given RFC 1141.
Try to reply with node address only when decrementing the TTL. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
Fix source IP address for ICMP unreachable packets generated by tinc. Try to send ICMP unreachable replies from an address assigned to the local machine, instead of the destination address of the original packet. The address is found by looking up the route towards the sender of the packet that generated the error; in usual configurations, this is the tinc interface. This also fixes the traceroute display in mtr when using the DecrementTTL option. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
Fix DecrementTTL option. The option was not actually working, as it could be seen on traceroute or mtr. The problem is that it was checking if the TTL was < 1 (so equal to 0) before decrementing it. This meant that a packet with a TTL of 1 was being sent with a TTL of 0 on the VPN, instead of being discarded with the ICMP error message. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
Drop h and hh length modifiers from printf format strings. C already guarantees that chars and shorts get passed as int. The few uses in tinc are mainly to print fields of struct addrinfo, and fields like ai_family have different sizes on different platforms, which actually caused some warnings to be generated.
Fix compiler warnings on Windows.
Make sure PriorityInheritance also works in switch mode.
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.