Commit graph

2774 commits

Author SHA1 Message Date
Guus Sliepen
24c3bebc5c In sssp_bfs(), never try to update myself. 2015-07-22 15:32:36 +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
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
thorkill
24af5b94a7 Forward edge information 2015-07-09 17:09:35 +02:00
thorkill
5cb5ab3412 Fix memory leak in setup_outgoing_connection
Do not allocate new configuration for outgoing connection if it's already initialized.
2015-07-09 01:04:57 +02:00
thorkill
1f2e14df8c merged with thkr-1.1-fix-0004 2015-07-08 00:44:08 +02:00
thorkill
5f6613e36f Attempt to fix the heap-use-after-free error in mst_kruskal
For some reason the edges ware removed in one direction resulting in e->reverse
point into invalid memory.

Do not insert edge into edge_weight_tree if not needed.
2015-07-08 00:36:22 +02:00
thorkill
06d4eac9ac 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-07 23:51:56 +02:00
thorkill
5ae403f9e6 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-07 23:51:43 +02:00
thorkill
de8b7a8dfb 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-07 23:14:08 +02:00
thorkill
e0d14e978f 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-07 21:19:26 +02:00
thorkill
80ccfb2894 Update weight if needed at the beginning 2015-07-07 20:50:53 +02:00
thorkill
78d0342a12 Update weight on reverse edge too 2015-07-07 20:49:16 +02:00
thorkill
0c334bb077 Do not insert edge into edge_weight_tree if not needed 2015-07-07 20:37:17 +02:00
thorkill
bb3fd0a985 Make usage of weight 2015-07-07 20:35:52 +02:00
thorkill
d49fd87dbc Attempt to fix the heap-use-after-free error in mst_kruskal
For some reason the edges ware removed in one direction resulting in e->reverse
point into invalid memory.
2015-07-07 00:05:58 +02:00
thorkill
77eac310c5 Revert "Set edge->reverse to NULL before we free it"
This reverts commit eda9f0ea8e.
2015-07-06 01:54:01 +02:00
thorkill
8dcd2a9995 Do not delete edges which differ only by weight
Added special case where we get weight update from other node.
Previous version called edge_del() which caused segmentation
faults in mst_kruskal.
2015-07-06 01:52:40 +02:00
thorkill
38c42fb973 Move the edge weight update handling to edge.c 2015-07-06 01:50:31 +02:00