Jeff Becker
172c2dec45
create new constexpr for the staleness window for introsets and use it in publishing introsets and intro selection
2021-11-16 12:22:08 -05:00
Jason Rhinelander
189c4bfba4
Also consider last publish; eliminate unwanted condition
...
We don't really carry about when the last regen was attempted, but
rather about when the last publish was attempted (or succeeded).
2021-11-16 12:21:57 -05:00
Jeff Becker
8ba03de44e
match timeouts in introset selection spread with logic for publishing
2021-11-16 10:57:17 -05:00
Jason Rhinelander
0fe7153f6e
Fix client latency bug; De-shared_ptr IHopHandler queues
...
- Replace m_FlushWakeup with a call to the router's god mode pump
method. m_FlushWakeup apparently isn't enough to get things out, and
we can end up with incoming packets that don't get properly handled
right away without it.
- The shared_ptr around the ihophandler queues isn't needed and is just
adding a layer of obfuscation; instead just exchange the list directly
into the lambda.
- Use std::exchange rather than swap
- A couple other small code cleanups.
2021-11-15 13:39:57 -04:00
Jason Rhinelander
70553c7627
Remove hopeless flush
...
The TriggerPump just below this is *already* going to trigger a flush,
so the extra flush call here can't do anything useful (and in
particular, it won't clear up the queue *immediately*, which is what
this code looks like it was aimed at doing).
2021-11-15 13:39:52 -04:00
Jason Rhinelander
fbc5cb0a6d
Add another missing pump trigger
2021-11-15 13:38:24 -04:00
Jason Rhinelander
bce7e2e56d
Pump outbound context
2021-11-15 13:38:21 -04:00
Jason Rhinelander
846577a0aa
Add missing inbound traffic pump trigger
2021-11-15 13:38:10 -04:00
Jason Rhinelander
8cdde74020
Simplify
2021-11-15 13:38:08 -04:00
Jason Rhinelander
f9395cd5dd
Cleanup: avoid pointless copy of this
pointer
2021-11-15 13:38:00 -04:00
Jason Rhinelander
9844d358e6
Fix packet delay creep
...
- Make the main PumpLL also pump hidden services, rather than using
separate wakers in each TunEndpoint. It seems there is some
interactions that just one or the other is not enough.
- Eliminate TunEndpoint send queue -- it isn't needed as we can just
send directly.
2021-11-15 13:37:57 -04:00
Jason Rhinelander
78cc466bf2
Rename PumpLL -> TriggerPump
...
And rename the actual pump implementation back to PumpLL.
2021-11-15 13:37:47 -04:00
Jason Rhinelander
031ea7aa37
Get rid of external event loop direct wakeups
...
If something needs to wake up the event loop it should be using an
async, as we are now with PumpLL(); but we had various code triggering a
wakeup, expecting that PumpLL gets called on every wakeup, which isn't
true anymore.
2021-11-15 13:36:44 -04:00
Jeff
1846c3e3d8
prevent bizare half open state. ( #1754 )
...
* attempt path timeout bullshittery fix
* make sure ServiceInfo always has its address set up
* do not copy intros in constuctor, ammend logging and
add assert
2021-10-12 17:37:01 -04:00
Jason Rhinelander
9dd604820f
Unleak exit mode DNS via unbound DNS trampoline on (macOS)
...
When we enable/disable exit mode on this restarts the unbound DNS
responder with the DNS trampoline (or restores upstream, when disabling)
to properly route DNS requests through the tunnel (because libunbound's
direct requests don't get tunneled because unbound is inside the network
extension).
2021-09-02 14:17:10 -04:00
Jeff Becker
e7ac0f3902
expunge outbound contexts that have not gotten inbound traffic for a long while
2021-07-05 09:09:20 -04:00
Jeff Becker
abd6e4c558
use weak_ptr instead of bare pointer to prevent use after free
2021-06-25 05:08:31 -04:00
Jeff Becker
3ad59105ef
when an outbound context is "marked bad" we want to ignore any new paths.
...
before this commit when a new path was made when an outbound context marked bad lokinet would segfault.
2021-06-23 07:21:01 -04:00
Jeff Becker
67f8a7116f
if we get a discard message from the pivot discard the outbound context if the remote intro is also expired
2021-06-21 16:02:03 -04:00
Jeff Becker
0900ab88d1
publish introsets on nearest routers
...
fetch introset from random routers
2021-06-21 16:01:38 -04:00
Jeff Becker
ee5723ecdc
add upperbound to number of endpoints used in lns lookups
2021-06-21 15:16:28 -04:00
Jeff Becker
3393b5a5a7
make it so lookups dont time out
2021-06-21 15:16:27 -04:00
Jeff Becker
b5efb8c604
rename local variable to be clear about meaning, add comment
2021-06-21 15:16:27 -04:00
Jeff Becker
1a0e6a7ac1
remove redundant check as ReadyToSend also checks IntroSent()
2021-06-21 15:16:27 -04:00
Jeff Becker
d45f0f8951
value initialize introduction so that expiresAt defaults to zero
2021-06-21 15:16:27 -04:00
Jeff Becker
9f353238af
ReadyToSend also should include checking we have a path to the remote
2021-06-21 15:16:27 -04:00
Jeff Becker
4b11858bb0
make clang compile, remove unused variable
2021-06-21 15:16:27 -04:00
Jeff Becker
963250c0ef
format
2021-06-21 15:16:27 -04:00
Jeff Becker
00d4942d85
more
2021-06-21 15:16:26 -04:00
Thomas Winget
7f9a60066b
make sure we have a path to the next introduction we want to use
2021-06-21 15:16:26 -04:00
Jeff Becker
d9cae4a6c6
in outbound context, ShouldBuildMore intro.ExpiresSoon delta is too big and has no overlap, change it so that
2021-06-21 15:16:26 -04:00
Jeff Becker
e48feb8b9a
kill outbound context when we remove our convotag
2021-06-21 15:16:26 -04:00
Jeff Becker
71d17dc2c9
format and logging
...
ignore outbound session auth messages
2021-06-21 15:16:26 -04:00
Jeff Becker
b70ecade2b
correct the logic for inbound convos
...
send back traffic on the correct path
2021-06-21 15:16:25 -04:00
Jeff Becker
ce7643a3aa
remove case that spams build on an outbound context
2021-06-09 09:36:08 -04:00
Jeff Becker
c97fe4aa96
convert magic number to where it came from
2021-06-08 18:07:54 -04:00
Jeff Becker
3594d3e211
spelling fix
2021-06-08 17:54:40 -04:00
Jeff Becker
f9e0c8f50c
add idempotent wakeup for flushing instead of the dumb queue checking
2021-06-08 17:38:04 -04:00
Jeff Becker
e2bdf8792b
typofix
2021-06-08 17:27:50 -04:00
Jeff Becker
5a713b0142
tweak timeouts to be a bit more sane
2021-06-08 14:36:33 -04:00
Jeff Becker
c2722be81c
this fixes the shit wtf
2021-06-08 14:36:33 -04:00
Jeff Becker
5909ad0386
add MarkAddressOutbound to plainquic
2021-06-08 14:36:33 -04:00
Jeff Becker
cce15b13c8
dont establish paths to inbound sessions to try and address state race condition
2021-06-08 14:36:33 -04:00
Jeff Becker
aefab797d7
unconditional putsenderfor
2021-06-08 14:36:33 -04:00
Jeff Becker
0096bd4e35
account for path latency in introset lookups on outbound contexts
2021-06-08 14:36:32 -04:00
Jeff Becker
e4ed53224c
use weak_ptr on a path to reference its parent pathset instead of a bare pointer so crashes dont happen
2021-06-08 14:36:32 -04:00
Jeff Becker
c6660dd6c1
add path aligntment timeout to send and connect timeouts on outbound context to reduce the chance of timing race conditon
2021-06-08 14:36:32 -04:00
Jeff Becker
108b8e089e
HandleTimeout can touch iterators so do all handling of lookup timeouts outside of loop iteration
2021-06-08 14:36:32 -04:00
Jeff Becker
0f1e806155
don't kill outbound context after build or lookup fails
2021-06-08 14:36:32 -04:00
Jeff Becker
a7b20b79c5
add relay order to error message
2021-06-08 14:36:31 -04:00
Jeff Becker
34e31ba04f
only inform failure or success of introset lookups when all lookups have returned
2021-06-08 14:36:31 -04:00
Jeff Becker
220b8837da
delay setting sentIntro by the advertised latency of the remote intro instead of static value
2021-06-08 14:36:31 -04:00
Jeff Becker
c5a86a49a3
defer ready to send state until after we send a handshake
2021-06-08 14:36:31 -04:00
Jeff Becker
40a189a9a3
log drop events more
2021-06-08 14:36:31 -04:00
Jeff Becker
00257567c2
dont call null handler
...
if we have no path to the remote router that's fine still use it just in case we have no other convotags
2021-06-08 14:36:31 -04:00
Jeff Becker
85cd1b6863
use inbound sessions we don't have paths to in GetBestConvoTagFor just so we can give the caller SOMETHING.
2021-06-08 14:36:31 -04:00
Jeff Becker
b03d17bc8e
dont change send timeout for exits from tun handler as that screws with consistency in testing.
...
improve log messages, provide more info
2021-06-08 14:36:30 -04:00
Jeff Becker
a94c100e7b
improve log messages about expiring convotags
2021-06-08 14:36:30 -04:00
Jeff Becker
42d75b934d
remove service nodes we can't look up from the nodedb as client
2021-06-08 14:36:30 -04:00
Jeff Becker
8dd1358cc6
* tweak introset handover timeouts
...
* introset path haodver tweaks
* improve warn/error messages to convey more information
* dont block on queue insertion
* reset convotag on decrypt/verify fail
* add multiple ready hooks on outbound context
* lookup introsets from close routers on dht
* continue to tick dead sessions so they expire their paths
* introset spacing
* reduce lns lookup diversity requirement for speed
* add a function to send reset convotag message
* only have 1 outbound context at a time
2021-06-08 14:36:30 -04:00
Jeff Becker
9a1a022d62
add relayOrder awareness to introset lookups.
...
* only propgate fail when relay order is non zero as zero relay order often fails
2021-06-08 14:36:30 -04:00
Jeff Becker
b1d30f9803
updates to lokinetmon
...
* add introset inspector mode
* add required parts for introset insecptor mode to rpc introspection
2021-06-08 14:36:29 -04:00
Jeff Becker
f172db75c5
don't defer call to ready hook with timer call it right away because we are ready
2021-05-16 19:31:59 -04:00
Jeff Becker
432e7f2a5a
update introset if we get a discard message from a possibly expired intro
2021-05-16 16:27:48 -04:00
Jeff Becker
970ccfcd4e
send a keep alive to keep an idle session alive so it doesn't get removed
2021-05-16 05:59:39 -04:00
Jeff Becker
f1efcc29ea
mark inbound traffic as convotag active
2021-05-15 15:27:28 -04:00
Jeff Becker
c5350ab2c4
DefaultPathAlignmentTimeout -> PathAlignmentTimeout
2021-05-11 05:12:27 -04:00
Jeff Becker
c834414b47
when we have to reestablish an outbound session use a much much higher timeout for restablishment
...
so it doesn't time out and get into a state that's totally screwed.
add virtual function service::Endpont::DefaultPathAlignmentTimeout() to get the timeout for path alignment
and use it for resetablishing outbound sessions
2021-05-11 05:12:27 -04:00
Jeff Becker
38cc130dc3
shift off bad intros when we get a discard message, this happens if the
...
other side's intro expires or the pivot restarts for whatever reason.
2021-05-10 09:01:46 -04:00
Jeff Becker
3c22e01d7c
in the event that a session is removed and then gets more traffic we would re-add the session with everything blank if there was more traffic in the same tick.
...
this remedies this behavior by only increment usage timestamps on sessions if they exist.
2021-05-09 08:00:31 -04:00
Jeff Becker
d3d929efa7
fixups in service endpoint
...
* increase publish introset timeout so that it does not time out on the network
* remove pedantic log warn
* make sure the path we are using for replying on inbound sessions is alive
* include convotag in log message so we know wtf is going on
* appease tom's autism, improve log message text
2021-05-06 16:34:24 -04:00
Jeff Becker
e916c9610c
format
2021-05-03 19:42:13 -04:00
Jeff Becker
f955bec5da
re-add parans
2021-05-03 15:18:21 -04:00
Jeff Becker
0826a557d6
use correct intro
2021-05-03 15:18:21 -04:00
Jeff Becker
f108af3d8b
only use alive paths for lookups
...
only track usage from sessions and don't care about intro timeouts
2021-05-03 15:18:21 -04:00
Jeff Becker
0005bee196
allow more than one outbound context per endpoint for fallback in case one outbound context takes a shit
2021-05-03 15:18:21 -04:00
Jeff Becker
83e70d95e0
dont invalidate cache on lns timeout, only on explicit negative
2021-05-03 15:18:21 -04:00
Jeff Becker
f9fe6f7e3b
consmetic fixes
...
* print names in lookup jobs instead of yyyyyy
* update syntax in construction of objects
2021-05-01 08:59:56 -04:00
Jeff Becker
f2e8b5547d
compat for lokinet 0.8.x
...
* don't send messages back that aren't expected
2021-05-01 08:58:50 -04:00
Jeff Becker
b31a484bc9
fix up outbound session
...
* prevent introset lookup spam
* change return values to void becuase bool doesn't mean fucking shit at all
2021-05-01 08:52:41 -04:00
Jeff Becker
b721b8d65b
finish wiring up config for #1595
2021-04-19 07:03:56 -04:00
Jeff Becker
fedc56e3f1
initial commit for #1595
2021-04-19 07:02:46 -04:00
Jeff Becker
545021aa3d
temp commit
2021-04-19 07:02:46 -04:00
Jeff Becker
4889b8cddf
fix up client to snode codepath
2021-04-19 07:02:45 -04:00
Jeff Becker
25e338d621
srv records
...
* add srv records in RCs if we have any
* add mechanism to add SRV records for plainquic exposed ports
* resign and republish rc or introset on srv record changes
2021-04-19 07:02:43 -04:00
Jeff Becker
94ecf02a62
add option to run lokinet traffic only with no exit and drop all non lokinet traffic
...
triggered by: exit-node=null
2021-04-19 07:00:27 -04:00
Jeff Becker
e005b34169
fix up some retarded bullshit
...
* llarp::service::NameIsValid was not checking that the tld was .loki, add this check.
* make link layer initial connection timeout 5s not the session activity timeout which happens to be 60 god damn seconds.
2021-04-19 07:00:26 -04:00
Jeff Becker
3f9e51e391
more liblokinet api functions
...
* get/set netid
* set log level
2021-04-19 06:59:07 -04:00
Jeff Becker
bac9341ae0
fix: if we have not used a session yet we only check the intro for expiration
2021-04-19 06:59:07 -04:00
Jeff Becker
95cd275cdd
liblokinet additions:
...
* add lokinet_add_bootstrap_rc function for adding an rc from memory
* prevent stack overflow on error closing connection in quic
* add in memory nodedb
* refactor how convotags are set as active
* add initial stubs for endpoint statistics
* refactor time stuff to be a bit cleaner
* update lnproxy script with more arguments
2021-04-19 06:59:07 -04:00
Jeff Becker
853cc52efb
wire up liblokinet
2021-04-19 06:59:06 -04:00
Jason Rhinelander
2a809c7a30
Add trace debugging of inbound packet type
2021-04-19 06:59:06 -04:00
Jason Rhinelander
35ead9dc6b
Remove superfluous block (FIXME: squash this with earlier "FIXME")
2021-04-19 06:59:06 -04:00
Jason Rhinelander
a2045cd966
Fix debug message
2021-04-19 06:59:06 -04:00
Jeff Becker
309a899c9f
mark loopback convotags as forever
...
make null handler mark discard data as activity for convotag
2021-04-19 06:59:06 -04:00
Jeff Becker
f310778f81
dont regenerate convotag on loopback when we have one already
2021-04-19 06:59:06 -04:00
Jeff Becker
abf8d2fb17
fix loopback convotag
2021-04-19 06:59:06 -04:00
Jeff Becker
5b05d22bad
refactors
...
* add path sequence numbers on routing messages
* reduce log level in debug mode
* wire up loopback style sending to ourself
2021-04-19 06:59:06 -04:00
Jeff Becker
f86a2daf83
fixes
...
* Add service::Endpoint::HasOutboundConvo
* dont mark outbound convos as inbound
* order quic packets
2021-04-19 06:59:06 -04:00
Jeff Becker
59c9e997f2
build paths faster and limit path builds at edge router instead of via a time counter for all edges
2021-04-19 06:59:05 -04:00