5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-23 04:21:34 +00:00
Commit Graph

206 Commits

Author SHA1 Message Date
Arceliar
7b12493417 panic if tcp startup fails, since otherwise a nil pointer occurs in multicast. make udp do the same thing. 2018-05-27 12:56:33 -05:00
Neil Alexander
a0f547cc1b
Fix being able to enable/disable multicast 2018-05-26 21:50:47 +01:00
Neil Alexander
bc899c395a
Fix accidental truncation of addresses ending in 8 on macOS and BSD 2018-05-26 21:47:54 +01:00
Neil Alexander
5d87601118
Add getMulticastInterfaces and getSelf to yggdrasilctl 2018-05-23 22:13:52 +01:00
Neil Alexander
1fd53bcb7d
Update comments in configuration 2018-05-23 14:02:13 +01:00
Neil Alexander
ce854a76bd
Add -normaliseconf option and temporarily correct old config item names in running config 2018-05-23 12:04:27 +01:00
Neil Alexander
9d9083e373
Update configuration names, fix multicast interface selection 2018-05-23 11:28:20 +01:00
Neil Alexander
6f79184c9b
Move multicasting into yggdrasil package 2018-05-23 11:13:53 +01:00
Neil Alexander
388ae09fca
Rename some config items 2018-05-22 23:43:29 +01:00
Arceliar
b10ae51565
Merge pull request #85 from neilalexander/yggdrasilctl
Human-readable formatting in yggdrasilctl
2018-05-21 19:21:00 -05:00
Neil Alexander
04b3e84023
Show your IPv6 address and subnet when starting 2018-05-21 16:15:31 +01:00
Neil Alexander
9567446f50
Offload formatting to yggdrasilctl and keep precision in JSON 2018-05-21 15:21:23 +01:00
Neil Alexander
59688dcab3
Fix formatting of bytes_sent, bytes_recvd, last_seen, uptime 2018-05-21 15:05:01 +01:00
Neil Alexander
ca3e541d3b
Friendly formats for getDHT, getSessions, setTunTap etc 2018-05-21 14:14:57 +01:00
Neil Alexander
201701ae4a
Add some pretty printing to yggdrasilctl, small modifications to JSON formatting in admin socket 2018-05-21 13:54:51 +01:00
Neil Alexander
bd32f5890b
Run gofmt -s -w 2018-05-21 07:28:03 +01:00
Neil Alexander
79131bb959
Minor tweaks 2018-05-20 23:25:07 +01:00
Neil Alexander
aae570de2a
Optional parameters are now square instead of pointed brackets, avoid nils for help 2018-05-20 21:57:05 +01:00
Neil Alexander
c765e0566f
Convert rest of functions, fix setTunTap 2018-05-20 21:54:15 +01:00
Neil Alexander
c75566d5ac
Various fixes and error catching, add setTunTap 2018-05-20 21:44:30 +01:00
Neil Alexander
4ecc7ce860
Add getTunTap to JSON admin socket 2018-05-20 19:42:37 +01:00
Neil Alexander
c3ca5c64b1
Add some more functions to JSON admin socket 2018-05-20 19:23:43 +01:00
Neil Alexander
9713e73969
Fix dot 2018-05-20 17:25:13 +01:00
Neil Alexander
a6ef7166ea
Start JSON-ifying the admin socket 2018-05-20 17:21:14 +01:00
Arceliar
5c0636eb3d add uptime and bytes sent/recvd to peer struct and getPeers 2018-05-18 20:41:02 -05:00
Neil Alexander
ca96bbf014
Accept exchanging an MTU of 0 to signify that TUN/TAP is disabled, don't send traffic to a node in that case 2018-05-18 18:56:33 +01:00
Neil Alexander
ec371af84f
Track TX/RX bytes over session and if MTU was adjusted, add to admin socket getSession 2018-05-18 17:59:29 +01:00
Arceliar
ec8fe338d5 more insertIfNew bugfixes, and add peerOnly to getDHT output (true if a node is in the bucket.peers slice instead of bucket.others--it means they're not regularly pinged, they're only there to make sure DHT lookups include them as a result, for bootstrapping reasons) 2018-05-17 21:43:26 -05:00
Arceliar
fe518f4e3f bugfixes related to peer timeouts in the DHT, significantly improve DHT bootstrap speed 2018-05-17 21:20:31 -05:00
Arceliar
8d9887294c add dht time since last ping to admin socket, some DHT code cleanup, bugfix to insertIfNew 2018-05-17 19:32:29 -05:00
Arceliar
d98640fd59 switch cleanup 2018-05-16 17:48:53 -05:00
Arceliar
6b51b44cbf slightly better variable naming 2018-05-16 17:36:37 -05:00
Arceliar
800ccaa3d4 cleanup 2018-05-16 17:32:26 -05:00
Arceliar
fe712d24f8 don't allow buckets to overflow when the next bucket isn't full 2018-05-16 17:24:38 -05:00
Arceliar
8228242eed misc dht and tree changes to stabilize coords and bootstrap the dht faster 2018-05-15 23:57:00 -05:00
Arceliar
96c55da987
Merge pull request #76 from neilalexander/hjson
Use HJSON for config instead of JSON
2018-05-13 15:09:28 -05:00
Neil Alexander
5299783e35
Add getTunTap to admin socket 2018-05-10 09:48:12 +01:00
Neil Alexander
e381808704
Add ability to select interface by friendly name on Windows 2018-05-09 16:42:24 +01:00
Neil Alexander
8ea3070a02
Small tweaks/clean up 2018-05-09 14:03:28 +01:00
Neil Alexander
45b106168e
Use HJSON instead of JSON 2018-05-09 13:54:31 +01:00
Arceliar
5dac273a3d rename to 'AllowedBoxPubs' and similar 2018-05-07 17:05:54 -05:00
Arceliar
6ce16d8192 debug admin socket 2018-05-06 19:48:26 -05:00
Arceliar
94dd231e13 add (not working) admin functions for auth keys, needs debugging 2018-05-06 19:31:19 -05:00
Arceliar
0b391b6e3a debugging and cleanup 2018-05-06 19:01:52 -05:00
Arceliar
80f893aac3 let the peer's linkLoop call close if the peer receives no announcements for too long 2018-05-06 17:17:12 -05:00
Arceliar
6026e0a014 Optional peer authentication, if non-empty then incoming TCP and all UDP peers must match one of these box keys 2018-05-06 16:32:34 -05:00
Arceliar
3a1b67da8c
Update admin.go 2018-05-05 20:20:38 -05:00
Arceliar
cdedd304af make removePeers work for TCP connections and minor admin cleanup 2018-05-05 17:14:03 -05:00
Arceliar
8b9a91be57 possibly fix weird issue I was having with netns, still not sure I understand why it was a problem 2018-04-28 16:39:58 -05:00
Neil Alexander
bdf9e45082
Default to previous scheme when url.Parse returns an error
In response to:
```
panic: parse x.x.x.x:xxx: first path segment in URL cannot contain colon

goroutine 33 [running]:
yggdrasil.(*Core).DEBUG_addPeer(0x8e58000, 0x8e34080, 0x12)
        /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}/src/yggdrasil/debug.go:317 +0x420
main.(*node).init.func1(0x8e48000, 0x8e58000)
        /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}/yggdrasil.go:75 +0x70
created by main.(*node).init
        /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}/yggdrasil.go:69 +0x410
```
2018-04-27 09:53:31 +01:00
Jeff Becker
fe13fea1e5
remove hard coded tor config options 2018-04-26 10:26:10 -04:00
Jeff Becker
7756891510
support socks proxy in peer url and decouple explicit tor/i2p routing 2018-04-26 10:23:21 -04:00
Jeff Becker
769b058004
more docs 2018-04-25 10:11:11 -04:00
Jeff Becker
1be8bbed1c
more docs 2018-04-25 10:09:09 -04:00
Jeff Becker
de69860e9b
* only enable tor proxy dialer when tor is enabled
* add docstrings
2018-04-25 10:06:13 -04:00
Jeff Becker
c16e354a44
Merge remote-tracking branch 'origin/master' into tor-auto 2018-04-25 10:01:10 -04:00
Arceliar
8ef2e55de6 try sending pings before sending searches for an unresponsive session 2018-04-22 15:31:30 -05:00
Jeff Becker
5e23185ddc
use address only not port 2018-04-20 08:41:09 -04:00
Jeff Becker
3c4fee0492
tor auto config 2018-04-19 10:30:40 -04:00
Neil Alexander
48ced483d6
Merge pull request #64 from Arceliar/dht
Limit DHT pings to 1/min per node
2018-03-17 20:46:47 +00:00
Arceliar
fe5ef4e867 don't add things to the dht rumorMill if they've been pinged in the last minute (arbitrary time, needs investigating) 2018-03-17 15:28:22 -05:00
Arceliar
0459f88b92 add a udp close packet, and partial support for a removePeer admin call (sends close to UDP peers, but doesn't close TCP connections yet) 2018-03-16 18:24:28 -05:00
Neil Alexander
bf0413a0c4
Modify ICMPv6 source address for "Packet Too Big" messages to a routable address so that it correctly routes to nodes in an yggdrasil /64 subnet 2018-03-10 22:31:36 +00:00
Arceliar
b34345229a remove any peers from the dht if a reset is triggered (from coord changes) 2018-03-10 15:16:39 -06:00
Arceliar
9ce0b7fbea keep peers separate from other nodes in dht 2018-03-10 13:58:48 -06:00
Neil Alexander
1155816df8 Show both UDP and TCP listen addresses in stdout (#51) 2018-03-07 09:41:04 +00:00
Neil Alexander
166d25619d Attempt to support NetBSD
This code actually consolidates a lot of the BSD code together, and even setting the interface MTU with SIOCSIFMTU seems to work fine.

What doesn't work though is setting the interface address using SIOCSIFADDR_IN6, which I attempted to plagiarise from the Darwin code.

As a fallback, ifconfig is used, which solves the problem enough to get it working.
2018-03-04 23:47:01 +00:00
Arceliar
cd0d1a1d26 get the fd instead of depending on water to do it 2018-03-04 13:57:34 -06:00
Arceliar
039c4a5a35 only try to build on openbsd and freebsd for now, darwin needs work too 2018-03-04 11:02:54 -06:00
Arceliar
478b80a07a cleanup 2018-03-04 10:56:46 -06:00
Arceliar
e7726cfb00 deduplicate some bsd tuntap code, still untested 2018-03-04 10:55:32 -06:00
Neil Alexander
c30792245a Add FreeBSD support in TAP mode 2018-03-04 16:24:50 +00:00
Neil Alexander
a92e6c2588
Merge pull request #29 from Arceliar/netlink
Linux: use netlink instead of ip
2018-03-04 10:47:34 +00:00
Arceliar
5ec6265a70 use netlink instead of ip commands to set address/mtu and bring up the tuntap device on linux 2018-03-03 16:41:36 -06:00
Arceliar
0460fdd301 panic if tun.write or tun.read returns an error and was launched from debug.go, since there's no way to recover in these scenarios 2018-03-03 13:56:26 -06:00
Arceliar
a367f2ca17 gofmt 2018-03-03 11:49:24 -06:00
Arceliar
0578a9f273 manual merge 2018-03-03 11:07:08 -06:00
Neil Alexander
4e5627f933 Update default interface MTU to use per-platform instead of global value 2018-03-03 12:43:39 +00:00
Neil Alexander
4917ea3dd2 Per-platform TUN defaults 2018-03-03 12:30:54 +00:00
Neil Alexander
bec898a326 Don't allow exceeding maximum MTU for a given platform 2018-03-03 11:47:14 +00:00
Neil Alexander
7c0102e43d Be a little bit less verbose on OpenBSD 2018-03-01 15:31:49 +00:00
Neil Alexander
6640b33334 Fix using 'auto' as device name on OpenBSD - default to /dev/tap0 2018-03-01 15:19:20 +00:00
Neil Alexander
24be3f1d67 Turns out FreeBSD is a bit different so restrict this to OpenBSD for now 2018-03-01 15:11:12 +00:00
Neil Alexander
90393ae03b Set interface flags properly on OpenBSD 2018-03-01 15:02:53 +00:00
Neil Alexander
9e4d169208 Set interface IP and MTU on BSD 2018-03-01 13:37:05 +00:00
Neil Alexander
f8dda26dba Add BSD support (openbsd, freebsd, solaris) 2018-03-01 11:49:49 +00:00
Neil Alexander
ebc4eacee4 Allow sane defaults on setTunTap 2018-02-28 15:27:58 +00:00
Neil Alexander
fdd32b9571 Add setTunTap 2018-02-28 15:15:57 +00:00
Neil Alexander
2b48fd1fce Add addPeer to admin socket 2018-02-28 13:43:06 +00:00
Arceliar
ddc4773b19 don't drop send/recv traffic going through the crypto workers, just block until they're free (TODO run further tests to make sure this doesn't cycle/deadlock) 2018-02-26 18:12:28 -06:00
Arceliar
63b55cda62 Mostly working PMTU discovery when going over UDP links 2018-02-25 20:24:36 -06:00
Arceliar
0470f6f1c1 cleanup 2018-02-23 13:04:52 -06:00
Arceliar
bb3ae8b39b temporarily limit PMTU to 2048, as a workaround to some pathelogical behavior where a TCP stream carried over a UDP peer can throttle down to 0 in the presence of significant packet loss 2018-02-23 12:46:22 -06:00
Arceliar
d3dc7765f2 trying to debug UDP+large MTU issues 2018-02-20 17:31:12 -06:00
Arceliar
a81c361484 tcp reconnect bufix, test with bufio, and switch back to tcp auto-peering by default to continue testing 2018-02-19 23:22:36 -06:00
Arceliar
a21a039b57 remove unused field from peer 2018-02-19 19:47:11 -06:00
Arceliar
4045597516 Use larger UDP chunks for link-local IP and let the OS fragment it. Switch to UDP for link-local peers. Minor code cleanup for TCP. 2018-02-19 19:34:51 -06:00
Arceliar
71150fcb86 ignore root tstamp updates if we just updated, to throttle the rate at which updates (and new signatures) can propagate 2018-02-17 23:57:24 -06:00
Arceliar
a66a29779a Slightly nicer way to throttle peer announcements 2018-02-17 23:41:42 -06:00
Arceliar
0fc7401635 check root before adding peers to the switch lookupTable, instead of during each lookup 2018-02-17 23:14:23 -06:00