Commit Graph

2698 Commits

Author SHA1 Message Date
kadmin 1f9021e287 add capability check 2021-07-08 20:15:38 +00:00
kadmin 9fd01334cf update with Josh's changes 2021-07-08 20:15:38 +00:00
kadmin c5cb642376 Add test for udp conn 2021-07-08 20:15:19 +00:00
kadmin 87fc7aa6b0 Clean up tests a bit more 2021-07-08 20:15:05 +00:00
kadmin 34c5677308 add timeout?
This adds most likely broken timeout code. I have no idea where the docs are for adding
timeouts, and there is only a very brief mention in the spec.
2021-07-08 20:14:46 +00:00
julianknodt 6d10acc6dd net/uring: add split for linux vs not for io_uring
This also adds a flag for checking whether it is active or not.

Signed-off-by: julianknodt <julianknodt@gmail.com>
2021-07-08 20:14:31 +00:00
kadmin 61e3d919ef net/uring: add go ntohs
Instead of calling out to C for ntohs, just implement it in Go for effiency.

Signed-off-by: kadmin <julianknodt@gmail.com>
2021-07-08 12:58:58 -07:00
Josh Bleecher Snyder cc5c696834 comment more 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 33c0997447 incorporate recvOut into recvReqs 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 08af39ae24 remove more dead code 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 43ccdc8879 document, cull dead code 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder e0abf1b3dd WIP: clean shutdown for UDP conn
this appears to work, most of the time.
there's lots of documentation work remaining,
thinking through the structure remaining,
testing remaining,
porting to file remaining (if appropriate).
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 7642d9fafd remove dead code 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder bf20f000fd overhaul error handling of peek/waitcompletion 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 4679379ebe refactor 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder f6b49d3e0e set sin_family (oops) 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder ae2f24ec4e remove some TODOs, make ip address extraction equally awful 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder ba49da429a simplify change point
at the cost of some very, very naughty unsafe
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 83742afabf convert manual tests into automated tests 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder b668e5d185 tewak 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 5410042dcd start cleaning up code 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 75efd794a3 ipv6 support, UNTESTED, super hacky 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 36a4741bc5 comments 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 208e6eb0db fix io_uring tun device reads
Well that's an interesting one!
Apparently if you issue multiple concurrent preadv calls on
a TUN device using io_uring, the TUN device falls over.

Possibly corrupting memory along the way.
Which might be why the kernel hung on shutdown...
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder fec66b4100 make it easy to toggle uring on/off 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder eff65381f2 switch file.go to test reads instead of writes 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder a8df9fa7cc simpler init 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 78fd2b7880 stick closer to upstream tun reading code 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 001dec84de make cgo pointer rules happy
well that was a mess
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder a8a7208dbd use io_uring for sendmsg
and clean up some dead code and unify some things
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder f254f779b5 disable polling for now
we'll maybe bring it back with a token bucket or something.
and/or do multi-sqe submission.
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 3d91c5b369 they work with extra junk
thanks, dave
no thanks, kernel devs

write no work
use writev
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 2a2ed7cd17 tun writes...not working yet (but why not??) 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 55c1ce00be use polling instead of syscall 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 4013c0edbb smush together two return values from C
avoids a per-packet alloc

i will atone for my sins later

if only C let you return multiple values.
or Go let you pass in a pointer w/o it being on the heap.
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 783d2d4327 keep 8 requests in the queue at all times 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 71f35bda1a remove all allocs 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder b83ac004f1 remove all allocations 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 59512181b5 mve sockaddr_in to Go 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder 1ee40d1670 move iovec to go 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder bbccf68a76 sheesh 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder d7a7e2d17d move msghdr to Go 2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder f26c0fcbd5 use io_uring 2021-07-08 12:56:49 -07:00
Christine Dodrill 1e83b97498
tstest/integration/vms: outgoing SSH test (#2349)
This does a few things:

1. Rewrites the tests so that we get a log of what individual tests
   failed at the end of a test run.
2. Adds a test that runs an HTTP server via the tester tailscale node and
   then has the VMs connect to that over Tailscale.
3. Dials the VM over Tailscale and ensures it answers SSH requests.
4. Other minor framework refactoring.

Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-07-08 11:38:01 -04:00
Christine Dodrill 97279a0fe0
tstest/integration/vms: add Oracle Linux image (#2328)
Oracle Linux[1] is a CentOS fork. It is not very special. I am adding it
to the integration jungle because I am adding it to pkgs and the website
directions.

[1]: https://www.oracle.com/linux/

Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-07-08 10:26:20 -04:00
Brad Fitzpatrick a9fc583211 cmd/tailscale/cli: document the web subcommand a bit more
Fixes #2326

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 21:16:33 -07:00
Josh Bleecher Snyder 0ad92b89a6 net/tstun: fix data races
To remove some multi-case selects, we intentionally allowed
sends on closed channels (cc23049cd2).

However, we also introduced concurrent sends and closes,
which is a data race.

This commit fixes the data race. The mutexes here are uncontended,
and thus very cheap.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-07-07 16:15:29 -07:00
Brad Fitzpatrick 7d417586a8 tstest/integration: help bust cmd/go's test caching
It was caching too aggressively, as it didn't see our deps due to our
running "go install tailscaled" as a child process.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 13:14:21 -07:00
Brad Fitzpatrick 3dcd18b6c8 tailcfg: note RegionID 900-999 reservation 2021-07-07 12:23:41 -07:00
Brad Fitzpatrick ddb8726c98 util/deephash: don't reflect.Copy if element type is a defined uint8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 11:58:04 -07:00