4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-07-10 23:06:29 +00:00
Commit Graph

103 Commits

Author SHA1 Message Date
bbcbbaf3b1 start migrating sessionInfo to be an actor 2019-08-23 20:05:18 -05:00
226dd6170d hopefully prevent a deadlock 2019-08-20 18:49:53 -05:00
fd5f3ca764 fix heap pop order 2019-08-16 23:07:40 -05:00
03b8af9f1a keep track of recent nonces with a heap and a map instead of a fixed-size bitmask 2019-08-16 18:37:16 -05:00
b2cb1d965c avoid leaking sessions when no listener exists, or blocking if it's busy 2019-08-12 18:22:30 -05:00
5e81a0c421 Use a separate buffer per session for incoming packets, so 1 session that floods won't block other sessions 2019-08-07 18:08:31 -05:00
9ab08446ff make sure the sessionInfo.recvWorker doesn't block if sinfo.recv somehow fills 2019-08-07 17:40:50 -05:00
790524bd1c copy/paste old flowkey logic into a util function, add a struct of key and packet, make WriteNoCopy accept this instead of a slice 2019-08-06 19:25:55 -05:00
679866d5ff have createSession fill the sessionInfo.cancel field, have Conn use Conn.session.cancel instead of storing its own cancellation, this should prevent any of these things from being both nil and reachable at the same time 2019-08-05 19:11:28 -05:00
979c3d4c07 move some potentially blocking operations out of session pool workers, minor cleanup 2019-08-04 16:29:58 -05:00
1e6a6d2160 use session.cancel in the router to make blocking safe, reduce size of fromRouter buffer so the drops in the switch are closer to the intended front-drop behavior 2019-08-04 02:21:41 -05:00
cbbb61b019 fix another drain on the bytestore 2019-08-04 00:00:41 -05:00
00e9c3dbd9 do session crypto work using the worker pool 2019-08-03 23:27:52 -05:00
befd1b43a0 refactor session worker code slightly 2019-08-03 23:14:51 -05:00
b9987b4fdc reduce time spent with a mutex held in sessionInfo.recvWorker 2019-08-03 22:47:10 -05:00
099bd3ae1e reduce part of sendWorker that needs to keep a mutex 2019-08-03 22:35:10 -05:00
5dfc71e1ee put bytes back when done 2019-08-03 22:00:47 -05:00
df0090e32a Add per-session read/write workers, work in progress, they still unfortunately need to take a mutex for safety 2019-08-03 21:46:18 -05:00
e0a3055c2f get rid of session workers, new util.PutBytes/GetBytes logic 2019-07-27 18:10:32 -05:00
cd29fde178 temporary workaround to concurrency bug in sessions.getSharedKey 2019-06-29 19:32:15 -05:00
7d58a7ef3e fix channel multiple close bug and concurrency bug in the way sessionInfo.close was being called 2019-06-29 17:44:28 -05:00
818eca90db fix nil pointer deref if searches fail, block dial until a search exceeds or a timeout passes (todo: replace timer with context) 2019-06-29 16:10:02 -05:00
e88bef35c0 get rid of old buffered session packets 2019-06-28 20:02:58 -05:00
e7cb76cea3 clean up unused old session maps 2019-06-28 19:21:44 -05:00
f545060e89 Add notes on isSessionAllowed checks 2019-06-13 23:37:53 +01:00
720a078a35 Add SetSessionGatekeeper
This allows you to define a function which determines whether a session connection (either incoming or outgoing) is allowed based on the public key.
2019-06-11 10:52:21 +01:00
3b6c726a3c Fix bug where MTU was ignored by sessions, resulting in default 1280 2019-05-29 19:11:12 +01:00
78eb40cbad Record session uptime (purely for the admin socket) 2019-05-29 12:59:36 +01:00
0059baf36c add a newConn function that returns a pointer to a Conn with atomics properly initialized 2019-04-26 18:07:57 -05:00
75130f7735 Fix TAP support again 2019-04-23 11:46:16 +01:00
d7a1c04748 It works, sort of, amazingly 2019-04-22 23:58:59 +01:00
ea8948f378 TUN/TAP addr/subnet to Conn mappings, other fixes 2019-04-22 20:06:39 +01:00
9778f5d2b8 Fix search behaviour on closed Conns, various other fixes 2019-04-22 15:00:19 +01:00
47eb2fc47f Break deadlock by creating session recv queue when session is created instead of repointing at search completion, also make expired atomic 2019-04-22 11:20:35 +01:00
5dada3952c use a session worker to try to avoid mutex hell. compiles, but incomplete and doesn't work yet 2019-04-21 20:38:14 -05:00
79bcfbf175 Change some mutexes to atomics, change conns map to pointers, sort of works but seems to deadlock very easily 2019-04-21 11:50:41 +01:00
d01662c1fb Try to convert TUN/TAP to use new yggdrasil.Conn, search masks are still broken 2019-04-20 16:32:27 +01:00
f3e742a297 Squash a whole load of races (and mutex half the world) 2019-04-20 11:53:38 +01:00
e31b914e38 Improve errors and handling of expired sessions 2019-04-19 23:30:43 +01:00
aac88adbed Listen-Accept-Read-Write pattern now works, amazingly 2019-04-19 22:57:52 +01:00
27b78b925d Move mutexes around 2019-04-19 21:23:15 +01:00
e3eadba4b7 Protect session nonces with mutexes, modify sent/received bytes atomically 2019-04-19 20:10:41 +01:00
ade684beff Signal when a session is closed, other tweaks 2019-04-19 10:55:15 +01:00
b20c8b6da5 Move some things around a bit, delete session workers 2019-04-19 00:11:43 +01:00
b2f4f2e1b6 Update errors, update Write 2019-04-19 00:07:26 +01:00
160e01e84f Searches called from api.go, various other tweaks, searches now have a callback for success/failure, node ID now reported by admin socket 2019-04-18 23:38:23 +01:00
58f5cc88d0 Fix session bug, fix dummy adapter, fix mobile framework builds 2019-04-01 19:59:50 +01:00
dd05a7f2a8 Tweaks 2019-03-28 19:09:19 +00:00
0b494a8255 Refactoring: move tuntap and icmpv6 into separate package 2019-03-28 00:30:25 +00:00
304f22dc1d re-enable session workers in a way that doesn't block and drops packets before decrypting if necessary 2019-02-28 20:05:21 -06:00