Commit Graph

537 Commits

Author SHA1 Message Date
Jeff Becker
2ee43c2162
set ipv6 address on apple to hardcoded value 2021-09-03 15:17:46 -04:00
Jeff Becker
b52cf97e11
override ShouldHandlePacket on android to bypass non .snode/.loki dns hooking. 2021-09-03 14:03:55 -04:00
Jason Rhinelander
38335f13a2 Remove debugging 2021-09-02 19:09:02 -03:00
Jason Rhinelander
e11efe9bc5
Reformat 2021-09-02 14:17:10 -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
7db2459469
macos sort of works now 2021-09-02 14:17:09 -04:00
Jeff Becker
a4a9062f12
dont save addrmap on android as it hangs 2021-09-01 12:07:10 -04:00
Jason Rhinelander
3ce329d2bf Reapply "fix dns on android" + fix argument order
The reason the dns fix on android didn't work is that the DnsInterceptor
had a reversed to/from argument order for its
`SendServerMessageBufferTo` overload, and so android/mac needed the
to/from to be reversed so that the second reverse cancelled out the
first one.

Upon review, the DnsInterceptor order (to, from) is more intuitive than
the base order (from, to), so this reapplies the dns fix and swaps
everything *except* DnsInterceptor to match the (to, from) argument
order.
2021-09-01 12:09:27 -03:00
Jason Rhinelander
a70035b7ec
Revert "fix dns on android"
This reverts commit dace0224ec.

This reportedly didn't fix things on Android, and most definitely breaks
macOS (with this we get a bunch of errors about expecting inbound when
we have outbound).
2021-08-31 18:58:03 -04:00
Jeff Becker
dace0224ec
fix dns on android 2021-07-09 09:51:51 -04:00
Jeff Becker
aa48a1de1b
lower log level 2021-06-23 07:30:30 -04:00
Jeff Becker
872a8d8045
use exisitng convotag first instead of trying to send to directly 2021-06-21 15:16:28 -04:00
Jeff Becker
71d17dc2c9
format and logging
ignore outbound session auth messages
2021-06-21 15:16:26 -04:00
Jeff Becker
5c3b4090d2
dont mark inbound sessions as outbound when we get a DNS lookup for it 2021-06-21 15:16:26 -04:00
Jeff Becker
a6fbaa7c7a
add dns hosts file option for user side dns filtering 2021-06-20 05:59:22 -04:00
Jeff Becker
a24b82119b
fix #1655
* make it so that we don't set up unbound resolver when we have no resolvers provided by config
* clean up dns codepath and make it use llarp::SockAddr instead of llarp::IpAddress
2021-06-20 05:59:22 -04:00
Jeff
c9b4ca85b2
[feature] optionally keep inbound convos mapped to same IP on restart (#1672)
* add option to persist address mappings between restarts using [network]:persist-addrmap-file

* make it work

* only persist address map for inbound convos

* turn persisting address map on by default

* dont load addrmap file if it has been modified last over a minute ago to prevent foot cannons fired from loading a really old version of it
2021-06-17 12:05:50 -04:00
Jeff Becker
9a51e4d9b5
forgot to pump on wakeup 2021-06-09 08:45:52 -04:00
Jeff Becker
7dc1061461
mark ip active on successful send 2021-06-08 14:52:16 -04:00
Jeff Becker
07e29da5c0
when we map an address forever mark it as outbound 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
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
a8964a6d8a
add idempotent wake up for sending messages to the network and writing packets on interfaces 2021-06-08 14:36:32 -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
97df84994e
make packet sending logic not attempt to align back to inbound sessions. 2021-06-08 14:36:29 -04:00
Jeff Becker
4994208fbc
don't cache dns result if we have an address mapped.
we want to use dns to trigger a call to EnsurePathTo
2021-06-08 14:36:29 -04:00
Jeff Becker
5e761235d6
improve log message clairity by printing the address not hex 2021-06-08 14:36:29 -04:00
Jeff Becker
95537804cd
separate white/grey list for active/decommissioned nodes.
allow sessions to decommissioned nodes but not paths.
2021-06-07 10:57:33 -04:00
Jeff Becker
7c6bb9a24c
simplify loop and correct logic, we want to bail out of the loop on first match. 2021-05-15 15:27:28 -04:00
Jeff Becker
ae97b87111
exits don't rewrite ip addresses, fix this and add note 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
6bb31468d7
don't send nx if we have an address already mapped 2021-05-06 16:34:37 -04:00
Jeff Becker
d563e3b340
if a path's latency is zero dont use it because it's not actually a zero latency path it's probably about to be failed or timed out
increase default path alignment timeout
2021-05-03 09:22:06 -04:00
Jeff Becker
54f9e1b44e
make path alignment timeout configuable
adds [network] section parameter called path-alignment-timeout that allows configring the timeout
for optional name lookup + introset lookup + aligned path build, used by tun endpoint dns, provided
as milliseconds.
2021-05-01 16:25:32 -04:00
Jeff Becker
c6320724d3
parameterize traffic alignement timeout in dns lookups 2021-05-01 08:55:54 -04:00
Jason Rhinelander
1d48cd6d35 format 2021-04-28 17:07:44 -03:00
Jason Rhinelander
4ef25ef679 Add systemd-resolved dynamic DNS updating
Wires up systemd support to configure DNS on startup and when
enabling/disabling exit mode.

On startup (and when turning off an exit) we tell systemd-resolved to
direct .loki and .snode lookups to lokinet (leaving other DNS traffic
alone).

On exit enabling, we reconfigure it to resolve "." (i.e. the root DNS
domain) so that all lookups come into it.
2021-04-28 16:48:10 -03:00
Jeff Becker
714f6b0183
macos variant fixes 2021-04-20 09:44:52 -04:00
Jeff Becker
71391957c5
set up accept any plainquic handlers 2021-04-19 11:20:46 -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
a7a886e670
fix infinite iteration 2021-04-19 07:02:45 -04:00
Jeff Becker
07eaeb681a
try fixing deadlock 2021-04-19 07:02:45 -04:00
Jeff Becker
1ea77e6a68
more client to snode quic fixes 2021-04-19 07:02:44 -04:00
Jeff Becker
e1f90e5e5a
use rx id on snode side of paths
set protocol on reply routing messages
2021-04-19 07:02:44 -04:00
Jeff Becker
2e8f47a7fa
various cleanups 2021-04-19 07:02:44 -04:00