Commit graph

3090 commits

Author SHA1 Message Date
Guus Sliepen
5ad43673ac Add -I m4 back to ACLOCAL_AMFLAGS.
In commit b7b5d51, AC_CONFIG_MACRO_DIRS([m4]) was added to configure.ac,
which is the current proper way of including the m4 directory. However,
old versions of autoconf ignore it and need the -I m4 statement in
Makefile.am. Both the old and new way of indicating that the m4/
directory should be included can coexist.
2015-09-24 17:10:25 +02:00
Nathan Stratton Treadway
ae89a25695 Fix invalid checksum generation.
Use equation 3 given in RFC 1624 and the UpdateTTL() example function given
RFC 1141.

# Conflicts:
#	src/route.c
2015-09-12 16:41:48 +02:00
hans
a9fb6db249 add malloc check
malloc can fail. check for errors or use xmalloc.
since this is bsd only, it is safe to use err and err.h.
2015-08-26 16:44:51 +02:00
Rafał Leśniak
569b1dbf15 Merge pull request #1 from jan-schreib/openbsd-build
Changes on Makefile.am and configure.ac to enable stack protection build on OpenBSD
2015-08-25 10:17:33 +02:00
hans
4710de8455 Activate fstack-protector-all on OpenBSD 2015-08-25 09:30:43 +02:00
hans
c9515a79de Make it build on openbsd.
Build on amd64 and sparc64.
2015-08-25 09:30:32 +02:00
thorkill
d9a8344467 Fix for unknown subnets
In a case where a node doesn't have AutoConnect = yes and StrictSubnet = yes
is set, the node would discard all ADD_SUBNET.
2015-07-26 15:14:40 +02:00
thorkill
af1213a7ae Revert "Do not recompile version if not needed"
This reverts commit 529576dad6.

This feature works only with gmake, BSD systems do not have
it and we do not want to force users to install it.
2015-07-26 12:22:22 +02:00
thorkill
529576dad6 Do not recompile version if not needed 2015-07-26 12:15:45 +02:00
thorkill
2d38e37168 Make make dist work when /bin/sh != /bin/bash 2015-07-24 19:14:20 +02:00
thorkill
618ddadeab Fixed a segfault when all nodes available for autoconnect has been exhausted
In cases when tinc has all available nodes in outgoing connections and
can not establish those connection due to network outage periodic_handler()
would crash since tmp_node_tree->count is 0.

This commit adds also new flag node->status.has_cfg_address to prevent
update_udp_address() from removing this flag.

Fixed node_status_t->unused - 13 + 19 = 32
2015-07-23 20:46:20 +02:00
thorkill
f12d4a3e6d Merged load_all_subnets and load_all_nodes to make autoconnect and strictsubnets work faster
When AutoConnect is on tinc needs to know if nodes have Address to defined
in thier hosts files. Currently tinc parsed node's host files if StrictSubnet
was enabled. To reduce the parsing overhead I have merged load_all_subnets
with load_all_nodes, such that load_all_subnets has been removed and
load_all_nodes has if-statement extracting Subnet information from node's host
file.
2015-07-23 18:34:29 +02:00
thorkill
3c67735720 Make autoconnect faster
When AutoConnect is enabled tinc tries to connect to other nodes picking them at random.
This may be sane default behavior but it may take ages if only few nodes have
defined Address in thier config.

Proposed solution to this problem:
- Filter out nodes without known address in periodic_handler
  I have added new node->status.has_known_address bool
- On update_node_udp() update this flag
2015-07-23 18:02:30 +02:00
thorkill
d16a43c06c Revert "It seems that this patch is needed. Strange things happens."
This reverts commit 50bf9b5a1a.
2015-07-22 15:32:36 +02:00
Guus Sliepen
24c3bebc5c In sssp_bfs(), never try to update myself. 2015-07-22 15:32:36 +02:00
Guus Sliepen
56a8b90d86 In sssp_bfs(), never try to update myself. 2015-07-22 14:33:56 +02:00
thorkill
0842bc0ca5 Revert "Added missing check to e->to->prevedge"
This reverts commit 4077acd583.
2015-07-21 19:39:08 +02:00
thorkill
512c64980a Merge branch 'thkr-1.1-ponyhof' of github.com:thorkill/tinc into thkr-1.1-ponyhof 2015-07-21 10:11:36 +02:00
thorkill
4077acd583 Added missing check to e->to->prevedge 2015-07-21 10:10:37 +02:00
thorkill
1edf49be14 Reduce logger calls 2015-07-20 11:10:27 +02:00
thorkill
8c4cdfc37c Prevent update_node_udp from changing our udp address
Follup to 6dbcd4eb3d

- myself is always reachable
- do not call update_node_udp if e->to == myself
2015-07-20 08:19:37 +02:00
thorkill
f75e6f61f2 Do not access e->to->prevedge if not defined
In some cases - mostly when e->to == myself the prevedge is set to NULL,
causing invalid memory access. In rare cases this may lead to malformed mst
or segfaults.
2015-07-19 22:33:43 +02:00
thorkill
6dbcd4eb3d Do not access e->to->prevedge if not defined
In some cases - mostly when e->to == myself the prevedge is set to NULL,
causing invalid memory access. In rare cases this may lead to malformed mst
or segfaults.
2015-07-19 18:54:08 +02:00
thorkill
bc747f8146 Merged changes with origin/1.1 2015-07-17 15:36:00 +02:00
thorkill
b68eaa7ce4 merged with origin/1.1 2015-07-17 00:29:46 +02:00
Guus Sliepen
f92c3446f2 Use AC_CONFIG_MACRO_DIR() instead of _DIRS().
The former is guaranteed to work with autoconf 2.58 and later, and we
don't have multiple m4 directories anyway.
2015-07-15 15:12:53 +02:00
thorkill
bf35e29e48 Changed log level 2015-07-14 14:29:44 +02:00
thorkill
3a99a76fa5 Do not forward multicast packets to prevent packet loops 2015-07-14 12:13:15 +02:00
thorkill
e282ed443f Define proper multicast subnets 2015-07-14 12:13:09 +02:00
Guus Sliepen
9ca1750245 Fix the PRF function when compiling without OpenSSL. 2015-07-12 16:31:32 +02:00
thorkill
3c54765bcd Prevent tinc from forgeting e->local_address
If ADD_EDGE came from tinc version 1.0.x local_address.sa.sa_family is set to 0.
If it came from tinc version 1.1.x forwarded for older verion it will be 255 - AF_UNKNOWN.
2015-07-12 13:32:38 +02:00
thorkill
1e7ef38198 Make sure we do not allocate new edge when talking to old nodes and the same edge already exists
When tinc gets ADD_EDGE from older versions it will allocate
new edge in protocol_edge.c:189 due to missed case in lines 149-171 where
local_address is not defined.
2015-07-12 13:31:07 +02:00
Guus Sliepen
7b831804aa Make subnet caches static. 2015-07-12 13:08:34 +02:00
thorkill
322ffadac4 Included missing names.h 2015-07-12 13:06:38 +02:00
Guus Sliepen
b7b5d51613 Use AC_CONFIG_MACRO_DIRS([m4]). 2015-07-12 13:05:51 +02:00
Guus Sliepen
97457716d7 Remove unused code that caused warnings about an uninitialized variable. 2015-07-12 12:55:13 +02:00
thorkill
b22b9d4389 Removed double break; 2015-07-12 12:39:36 +02:00
Guus Sliepen
b396585383 Fix undefined behaviour when left-shifting signed integers.
Found by -fsanitize=undefined.
2015-07-12 12:33:07 +02:00
thorkill
ce1c957e87 Added information about current node in tinc's top
The information is of grate value when monitoring multiple
nodes in one window. Without it the user is forced to quit top, exit tinc
and go back to shell to refresh his memory about which node is in
what window.
2015-07-10 23:57:20 +02:00
thorkill
970283c148 Still working on ConnectTo outgoing connections 2015-07-10 02:18:06 +02:00
thorkill
85bf50612b Fixed typo in if statement 2015-07-10 02:05:22 +02:00
thorkill
6c6675e72a Do not cancel outgoing reconnects to nodes defined with ConnectTo 2015-07-10 02:01:06 +02:00
thorkill
76d278a5c0 Set keep_it flag on outgoing connections which are set by ConnectTo 2015-07-10 01:44:49 +02:00
thorkill
606948116d Do not disconnect random hosts which are explicit set with ConnectTo 2015-07-10 01:43:24 +02:00
thorkill
bdab2e15f6 Make changes to edge more verbose 2015-07-10 01:09:51 +02:00
thorkill
ab3c7dded0 Yet another attempt to make edge update work as expected 2015-07-10 00:48:41 +02:00
thorkill
c18771a96d Make informative logs about edge changes 2015-07-09 23:49:52 +02:00
thorkill
f93352b095 Prevent packet loops when ICMP6 router solicitation packets are sent to tinc device
When tincd setups it's network device some operating systems send router
solicitation packets from local scope ip addresses. tincd forwards it
then to his neighbors then those nodes follow the same routine fowarding it
to the next hops. I may happen that an loop will occur consuming large amount
of bandwith. Constrains: Mode = Router, Broadcast = mst.

Reproduction: ping6 -c 1  ff02::2%<tincd interface>
Sending one packet will, depending on your setup, generate about 3k packets.

Proposed solution in this commit: enable StrictSubnets, tincd will reject such
packets due to unknown subnet.

Future work: check scope of the ip address and make decisions about forwarding
based on Mode tincd is configured to work.
2015-07-09 22:19:26 +02:00
thorkill
49cc329cf9 Reverted changes on EDGE_ADD update if weight differs 2015-07-09 17:33:17 +02:00
thorkill
0c30f9f0f1 Revert "Forward edge information"
This reverts commit 24af5b94a7.
2015-07-09 17:16:07 +02:00