Commit graph

2954 commits

Author SHA1 Message Date
thorkill
057ccb8da6 recvfrom return size_t not len 2016-05-15 19:12:41 +02:00
thorkill
e36af42ce4 Change type of the packet. 2016-05-15 18:48:24 +02:00
thorkill
99e0f5777c Small typo fix and set slpd sockt O_NONBLOCK 2016-05-15 17:24:07 +02:00
thorkill
756a6607e1 Silence log output 2016-05-15 00:39:18 +02:00
thorkill
cdd148204f Introduction to Simple Local Peer Discovery Protocol (SLPD)
Full functionality of tinc mesh relays on having at least one node,
accessible, with known address to which all other nodes must connect
in order to exchange information about other peers.

Sometimes, however, in smaller networks or if two or more peers are
located in the same LAN segment without access to any of the nodes with
known address, there is no way of establishing a functional mesh
without manually changing the configuration.

SLPD addresses this problem utilizing multicast groups and autoconnect.
- Node sends periodically simple message to multicast group
  (default 224.0.42.23 port 1655) in this format:
   "sLPD 0 1 nodename port publickey"

   "0 1" is the "major minior" version of the protocol

- Node listens to the multicast group for messages on all interfaces:
  - if the nodename is known and the publickey matches the
    node's public key the source address of the packet
    will be stored as learned ip address

- at this point setup_outgoing_connection() will be able to
  choose the learned ip for connect

Configarion example:
* Roadwarriors: SLPDInterval = 30
* Router on your home network or in your hackerspace:
 - It should broadcast only in the direction of the LAN thus you should
   set SLPDInterface = eth0 and SLPDInterval = 10
* Defaults:
 SLPDGroup = "224.0.42.23"
 SLPDPort = 1655
 SLPDInterval = 0 (means SLPD is disabled)

The check of the publickey is not implemented yet. IPv6 support
must be implemented. This is the first commit - highly experimental.
2016-05-15 00:24:35 +02:00
thorkill
4401c645ab Silence log messages on autoconnect 2016-05-14 23:21:36 +02:00
thorkill
39b23f7a11 Make edge update work when compiled with --disable-legacy 2016-05-14 23:18:44 +02:00
thorkill
231bd39986 Merge branch 'thkr-1.1-ponyhof' into thkr-1.1-1462915768-ein7jahS 2016-05-12 13:40:14 +02:00
thorkill
e4619ecce1 Merge remote-tracking branch 'guus/1.1' into thkr-1.1-ponyhof 2016-05-12 13:39:14 +02:00
thorkill
ddc74678b2 Fixed log message - it is destination not source address 2016-05-12 13:16:01 +02:00
thorkill
0cf943753a Send PKT_PROBE only when handshake has been done already. 2016-05-12 11:20:41 +02:00
thorkill
3ec36e6432 We still need excessive sptps logging 2016-05-11 23:39:09 +02:00
thorkill
3558ab5499 Removed additional debug output 2016-05-11 23:39:03 +02:00
thorkill
b27e9bfd74 We still need excessive sptps logging 2016-05-11 22:54:00 +02:00
thorkill
ca601087fc Removed additional debug output 2016-05-11 21:58:14 +02:00
thorkill
79621fd167 Merge branch 'thkr-1.1-ponyhof' into thkr-1.1-1462915768-ein7jahS 2016-05-11 19:41:40 +02:00
thorkill
ae199d9f2b Removed type check and debug output.
We will send PKT_PROBE in send_sptps_packet only if handshake has been completed.
2016-05-11 19:30:58 +02:00
thorkill
62064cc5ef Send PKT_PROBE only when handshake has been done already. 2016-05-11 19:30:07 +02:00
thorkill
c1af41e7f0 Removed type check and debug output.
We will send PKT_PROBE in send_sptps_packet only if handshake has been completed.
2016-05-11 19:29:04 +02:00
thorkill
037411aa29 Send PKT_PROBE only when handshake has been done already. 2016-05-11 19:27:05 +02:00
thorkill
a84019cf10 Split error handling for accurate log messages in sptps_verify_datagram
"Received short packet" was misleading.
2016-05-11 18:51:57 +02:00
thorkill
d0e9430a8c Split error handling for accurate log messages in sptps_verify_datagram
"Received short packet" was misleading.
2016-05-11 18:50:12 +02:00
thorkill
b585596082 Merge branch 'thkr-1.1-ponyhof' into thkr-1.1-1462915768-ein7jahS 2016-05-11 18:39:39 +02:00
thorkill
fe18e0ed29 Reverted changes to try_tx_sptps
- should fix the problem with unknown source
at the beginning of communication between nodes
2016-05-11 18:39:15 +02:00
thorkill
40acedd793 Reverted changes to try_tx_sptps
- should fix the problem with unknown source
at the beginning of communication between nodes
2016-05-11 18:37:01 +02:00
thorkill
41e801cbbd Revert "Temporal fix for 'unknown source' and broken direct UDP links."
This reverts commit 157bc90e64.
2016-05-10 23:51:22 +02:00
thorkill
0e6265f546 Removed backtrace callback function 2016-05-10 13:43:25 +02:00
thorkill
9d8af84933 Merge branch 'thkr-1.1-20160510-fix-pkt_probe' into thkr-1.1-ponyhof 2016-05-10 12:01:13 +02:00
thorkill
bd95c231ce Merge branch 'thkr-1.1-20160510-fix-receive_tcppacket_sptps' into thkr-1.1-ponyhof 2016-05-10 12:01:06 +02:00
thorkill
dc8ee9e6d1 Prevent receive_tcppacket_sptps from forwarding data when we are in handshake phase with those nodes
Forwarding data to node which does not have vaildkey yet would destroy
the running handshake.
2016-05-10 11:43:14 +02:00
thorkill
f7e2020b56 Allow PKT_PROBE in sptps_send_record
sptps_send_record prevented PKT_PROBE to be send in send_sptps_packet.
This occurred mostly when data was on "the wire" for some subnet.
route() would then trigger try_tx/try_udp which would be dropped by
sptps_send_record producing annoying amount of "Handshake phase
not finished yet" log messages.
2016-05-10 00:52:38 +02:00
thorkill
73ae43199c Allow PKT_PROBE in sptps_send_record
sptps_send_record prevented PKT_PROBE to be send in send_sptps_packet.
This occurred mostly when data was on "the wire" for some subnet.
route() would then trigger try_tx/try_udp which would be dropped by
sptps_send_record producing annoying amount of "Handshake phase
not finished yet" log messages.
2016-05-10 00:43:43 +02:00
thorkill
c5f46d3efb Removed backtrace callback 2016-05-10 00:37:39 +02:00
thorkill
75bca2543d Tabs vs spaces cleanup. 2016-05-10 00:17:38 +02:00
thorkill
c7d838eb41 Fixed autoconnect after merge 2016-05-08 16:46:29 +02:00
thorkill
08f1fd2f8d Fixes after merge with guus/1.1 2016-05-08 16:14:20 +02:00
thorkill
e6b85158f0 Added symbols necessary to link with logger.o 2016-05-08 16:12:41 +02:00
thorkill
4be26caf4e Merge remote-tracking branch 'guus/1.1' into thkr-foor2Vup 2016-05-08 15:58:29 +02:00
Guus Sliepen
0edef996a6 Releasing 1.1pre14. 2016-05-01 20:35:26 +02:00
Guus Sliepen
3f6c663a06 Revert "Remove tinc.service, it is not necessary."
This reverts commit 0b6f84f96e. Although
systemd does automatically provide a "tinc.slice" when there is only a
tinc@.service template, it doesn't quite work the same way as
tinc.service.
2016-05-01 12:07:44 +02:00
Guus Sliepen
0a6d89acc6 Releasing 1.1pre13. 2016-04-30 20:55:12 +02:00
Guus Sliepen
2055c3e21d AutoConnect now only chooses from nodes for which we know an address.
Based partially on work from Rafał Leśniak.
2016-04-30 20:11:55 +02:00
Guus Sliepen
0b6f84f96e Remove tinc.service, it is not necessary.
Thanks to Alexander Ried for pointing out that if you have
tinc@.service template, systemd will provide a default slice containing
all instances of that template. So "systemctl start tinc" will still do
what we want it to do.
2016-04-30 18:08:31 +02:00
Guus Sliepen
8377d0b856 Fix BSD tun device support.
This was broken by a botched merge from the master branch in commit d7f6737.
2016-04-27 20:30:36 +02:00
Guus Sliepen
390d25f0b8 Releasing 1.1pre12. 2016-04-24 13:23:06 +02:00
Guus Sliepen
5a7c6546a4 Don't check file permissions on Windows during fsck. 2016-04-23 21:39:53 +02:00
Guus Sliepen
83fa44ce42 Fix starting tinc as a service on Windows.
Don't assume tincd.exe is in the working directory, especially now that
chdir() is called very early. We use GetModuleFileName() instead.
2016-04-23 21:32:42 +02:00
Guus Sliepen
9a66d7499a Fix a compiler warning on Windows. 2016-04-23 21:32:29 +02:00
Guus Sliepen
ab5f4cbdc6 Fix possible read of freed memory when verifying the signature of a file. 2016-04-23 17:28:30 +02:00
Guus Sliepen
76955a6c8b Have "tinc fsck" recognize Ed25519PublicKey statements. 2016-04-23 17:20:08 +02:00