Commit Graph

1146 Commits

Author SHA1 Message Date
Ryan Tharp
6f261c321c Merge branch 'master' of https://github.com/neuroscr/loki-network 2018-10-24 03:34:08 +00:00
Jeff
b001d1f96b try fixing whatever memory corruption happens 2018-10-23 17:36:50 -04:00
Jeff
8c591ceb96 use default endpoint 2018-10-23 17:28:01 -04:00
Jeff
f35f34ede4 check for address 2018-10-23 14:18:00 -04:00
Jeff
c3989cbcf4 make dns work correctly with rdns, tired of waiting just make it fucking work. 2018-10-23 14:00:55 -04:00
Jeff
5ec9b651df ony publish to near router 2018-10-23 13:15:22 -04:00
Jeff
78448174f5 don't propagate introset too far 2018-10-23 13:04:35 -04:00
Ryan Tharp
4646779b0a refactor out net.hpp => net_addr.*, new inAddr struct API 2018-10-23 08:38:33 -07:00
Jeff
0e66ba2026 flush tun on macos 2018-10-23 09:52:14 -04:00
Jeff
cadc01a9b1 makeit work on macos 2018-10-23 09:18:48 -04:00
Jeff
6a6ceec514 Merge branch 'master' into dev 2018-10-23 09:14:04 -04:00
Jeff Becker
dccaa77e43
correct headers 2018-10-23 08:57:57 -04:00
Jeff Becker
4411d85040
fix headers 2018-10-23 08:40:34 -04:00
despair86
d8cfac47a8
ok updated to match recent changes 2018-10-23 07:56:59 -04:00
Jeff Becker
c262f8b5e3
bundle relevent libsodium parts 2018-10-23 07:29:37 -04:00
Jeff
4ea3549c21 tick and use std::unique_ptr 2018-10-21 13:07:17 -04:00
Jeff
b8ed9ceea8 fix kqueue and merge changes 2018-10-21 11:15:04 -04:00
Jeff
390333c787 Merge remote-tracking branch 'origin/master' 2018-10-21 10:58:01 -04:00
Jeff
146fa13837 merge 2018-10-21 10:57:36 -04:00
Jeff Becker
cc106ed37b
fix dht bug, probably, re-enable loopback testnet functionality 2018-10-21 10:19:49 -04:00
Jeff Becker
c6f1355c5d
Merge branch 'master' into dev 2018-10-21 09:07:48 -04:00
Jeff Becker
118954818c
try fixing memleak 2018-10-21 09:07:33 -04:00
Jeff Becker
d3bada5564
fix windows 2018-10-19 12:54:08 -04:00
Jeff Becker
51baf43e99
fix 2018-10-19 12:47:06 -04:00
Jeff Becker
94e4a6798c
fix windows 2018-10-19 12:44:35 -04:00
Jeff Becker
26ad679b1d
set send queue limit to something really big 2018-10-19 12:12:46 -04:00
Ryan Tharp
c3c2eda283 clang-format 2018-10-19 08:04:14 -07:00
Ryan Tharp
3b24b69513 TunEndpoint::ObtainAddrForIP(), identity tun range better, actually return revdns for tunmapaddrs, make in-addr.arpa matching smarter, actually send 404s, additional unit test 2018-10-19 07:53:06 -07:00
Ryan Tharp
db64547ab3 Merge branch 'master' of https://github.com/loki-project/loki-network 2018-10-19 12:33:13 +00:00
Jeff Becker
40b003b6fc
Merge branch 'dev' of ssh://github.com/loki-project/loki-network into dev 2018-10-19 07:41:47 -04:00
Jeff Becker
612057003a
de changes 2018-10-19 07:41:36 -04:00
Jeff
1cb2bb6136 Merge branch 'dev' 2018-10-19 07:35:51 -04:00
Jeff
cc3908f025 more changes 2018-10-19 07:34:27 -04:00
Jeff
71172fe72b use std::unique_ptr as to not leak like a motherfucker 2018-10-19 07:33:49 -04:00
Ryan Tharp
58c7443073 improve string handling of .loki, initial reverse hook handling 2018-10-18 05:17:02 -07:00
Ryan Tharp
0d9f42d87f stop iterator if visit returns false, fix funtion name typo 2018-10-18 05:14:26 -07:00
despair86
ae4a6ac217 fix ineffective RC bogon check
this used to write both private and public inet6 addresses into the RCs, for relays with port forwarding enabled
2018-10-16 12:49:41 -05:00
despair86
1a46631454 remove unused code 2018-10-16 12:25:26 -05:00
despair86
9d546cbac4 separate read and write event ports to avoid overwriting queue events 2018-10-16 12:18:29 -05:00
despair86
d4a7dfd08d remove extra code, pass the buffer size to read() directly, check for overflow 2018-10-16 12:18:29 -05:00
despair86
b2cb4cd0e8 fix uint 2018-10-16 12:18:28 -05:00
Jeff Becker
e6a8edffbf
call hook 2018-10-16 11:57:17 -04:00
Jeff Becker
9a962540fb
update eventloop on win32 2018-10-16 11:27:31 -04:00
Jeff Becker
15c99f3192
unit tests for bogons 2018-10-16 11:25:50 -04:00
Jeff Becker
7960752430
fix crash 2018-10-16 07:14:41 -04:00
Jeff Becker
1a55839e26
Merge branch 'dev' of ssh://github.com/loki-project/loki-network into dev 2018-10-15 17:20:58 -04:00
Jeff
1da0f9f6f5 path randomization for lookups on failure 2018-10-15 17:20:05 -04:00
Jeff Becker
ff26f2dcff
do bounds check 2018-10-15 12:20:45 -04:00
Jeff Becker
d7c188d817
Revert "add a check for overlow in event loop"
This reverts commit 1042c73829.
2018-10-15 12:19:48 -04:00
Jeff Becker
1042c73829
add a check for overlow in event loop 2018-10-15 12:09:34 -04:00
Jeff Becker
f72a954029
log endpoint when requesting introset 2018-10-15 11:43:41 -04:00
Jeff Becker
acaeb26f45
shift intro if expired before building next message 2018-10-15 09:45:42 -04:00
Jeff Becker
d3278946f2
ipv4 bogon checking 2018-10-15 08:02:32 -04:00
cathugger
ca01daa89a
ip: support DCCP and UDP-Lite, TCP chksum twx; tun: more filtering 2018-10-15 00:56:14 +03:00
cathugger
d0c35803a5
tun+ip: filter packets at destination, drop instead of truncating 2018-10-13 21:57:31 +03:00
cathugger
360ccc33de
ip: more one's complement math improvements 2018-10-13 21:31:50 +03:00
cathugger
4d5f5fecfa
ip: make things fragmentation-aware, cleanup UDP handling; also format
one's complement math is pretty fun
2018-10-13 18:42:47 +03:00
Jeff Becker
bf9512dfaf
Merge remote-tracking branch 'ryan/master' 2018-10-12 08:05:03 -04:00
Jeff Becker
8bf28940d1
Merge remote-tracking branch 'cathugger/master' 2018-10-12 08:02:37 -04:00
despair86
7f226d7734 revert merge
(i can put these in the dev branch for now)
2018-10-12 06:48:53 -05:00
cathugger
18c20396b6
add {h,n}uint16_t types, optimize TCP/UDP checksuming
use static functions + switch instead of lambda functions + map.
2018-10-12 04:38:16 +00:00
despair86
5576254c2e make it compile on nt 2018-10-11 19:22:11 -05:00
despair86
88854f558e Revert "return the correct address family?"
not really needed....looks safe so long as the bytes are in network order (hence, the inet4 link will only grab the top 32 bits of the whole inet6 address field.)
This reverts commit 56e41ebda0c29bb2a85dd3f8dbbfba30da8c0a2c.
2018-10-11 19:22:11 -05:00
despair86
7d30d9ee38 return the correct address family? 2018-10-11 19:22:11 -05:00
despair86
e08dedf7a2 really fix endianness 2018-10-11 19:22:10 -05:00
despair86
630cf99bae fix inet4 to inet6 transition bug 2018-10-11 19:22:10 -05:00
Ryan Tharp
fd41f7b3db just make sure everything is initialized, fix typo in testing debug 2018-10-11 12:22:29 +00:00
Ryan Tharp
316df4703a merge 2018-10-11 12:21:30 +00:00
Ryan Tharp
14ccb2f81e Merge branch 'master' of https://github.com/loki-project/loki-network 2018-10-11 12:21:16 +00:00
Jeff Becker
252b2ee3fb
move function into source file out of header and add operator overloading for == and != on introset 2018-10-11 07:41:10 -04:00
cathugger
71c9965471
ip: code cleanups and compatibility improvements
do not assume that packets come with address zero-ed, older clients don't do that.
they don't modify checksum either, therefore we should be able to get correct checksum if we use deltachksum with old and new addresses.
2018-10-10 21:41:53 +00:00
Jeff
e0c6404830 fix previous commit 2018-10-10 17:37:45 -04:00
Jeff
0023c15d0f fix introset expiration 2018-10-10 17:31:03 -04:00
Jeff
fd37100ac8 typofix 2018-10-10 15:24:04 -04:00
cathugger
257ce99f43
ip: fix UDP checksum offset 2018-10-10 17:51:37 +00:00
cathugger
e1c7d8a696 some tweaks and fixups 2018-10-10 15:50:52 +00:00
cathugger
4971fae171 uint32_t byte ordering type safety 2018-10-10 15:16:10 +00:00
Ryan Tharp
47a67cdefb restructure casting to avoid crash 2018-10-10 06:33:25 -07:00
Jeff Becker
aa988a6fa4
Merge remote-tracking branch 'cathugger/master' 2018-10-10 08:10:04 -04:00
cathugger
05e6c31238 ip: some fixes and tweaks 2018-10-10 12:06:28 +00:00
Jeff Becker
1d7b0d77a9
Revert "make it compile :DDDD"
This breaks the build and reverts commit 6732cbf54f.
2018-10-10 07:58:04 -04:00
Jeff Becker
6732cbf54f
make it compile :DDDD 2018-10-10 07:51:11 -04:00
Jeff Becker
32a028f6d8
Merge remote-tracking branch 'cathugger/master' 2018-10-10 07:48:44 -04:00
Jeff Becker
cbfc73515e
fix zeroing of addresses, put it in the right place 2018-10-10 07:47:30 -04:00
cathugger
5169df546c ip: UDP checksum recalculation support 2018-10-10 05:38:59 +03:00
cathugger
7fd501e528 ip: use deltachksum for IPv4 headers aswell 2018-10-10 04:59:52 +03:00
cathugger
36ea776d07 ip: try to fix deltachksum 2018-10-10 04:29:44 +03:00
cathugger
0f8e0e9d58 tun: fix "fix "clear src/dst addresses and checksum before sending""
correct dst address is required for FlushSend to work, so do IP address and checksum null'ing there.
dang myself.
2018-10-10 03:28:53 +03:00
cathugger
4f7ae52cad tun: fix "clear src/dst addresses and checksum before sending"
clearing of addresses and checksum was put in wrong place, so it null'd everything before writing to tun interface.
damnit jeff.
2018-10-10 03:00:48 +03:00
cathugger
ed39cb98e1 ip: (try to) fix deltachksum 2018-10-10 00:56:20 +03:00
cathugger
c515e4a248 ip: avoid pointless length checks 2018-10-10 00:09:16 +03:00
cathugger
a92e7c2104 ip: fix stupid MIN thing 2018-10-09 20:49:20 +03:00
cathugger
b5392c5679 make format 2018-10-09 20:09:45 +03:00
cathugger
2f4b0fbda6 ip: use delta TCP checksum calculation, don't recalculate ICMP checksum 2018-10-09 20:02:49 +03:00
cathugger
4cba59f3c4 tun+ip: clarify what happens where 2018-10-09 17:09:03 +03:00
Ryan Tharp
529cd4e6a3 expose dns_query and build_dns_packet() 2018-10-09 05:41:33 -07:00
Ryan Tharp
c8c4a0da10 don't risk any SOA crashes, fix language types 2018-10-09 05:40:53 -07:00
Ryan Tharp
924c3c0895 fix cast 2018-10-09 05:38:41 -07:00
Jeff Becker
eb9150431f
make it compile 2018-10-09 08:32:02 -04:00
Jeff Becker
6d7d6f6efa
clear src/dst addresses and checksum before sending (infoleak) 2018-10-09 08:29:46 -04:00
Jeff Becker
a7f8da4cbc
fix double free 2018-10-09 08:10:20 -04:00
Jeff Becker
475ac63f4a
initial admin api infra 2018-10-09 08:06:30 -04:00
Ryan Tharp
7550d6b022 revert Jeff's misunderstanding 2018-10-09 11:02:53 +00:00
Ryan Tharp
2fb5eaba1c remove getSockAddr() per Jeffs PR CR, add additional notes to reduce confusion 2018-10-09 11:02:06 +00:00
Ryan Tharp
4d3ad13daa Merge branch 'master' of https://github.com/loki-project/loki-network 2018-10-09 10:41:19 +00:00
Ryan Tharp
9bc9eed1d5 Merge branch 'master' of https://github.com/neuroscr/loki-network 2018-10-09 10:41:00 +00:00
Jeff
bb3bed11dc try better handover logic again 2018-10-08 17:24:00 -04:00
Jeff
07871827d0 swap intro 2018-10-08 16:41:50 -04:00
Jeff
608768628a don't rebuild 2018-10-08 16:05:05 -04:00
Jeff
78b82f9a5e try not killing paths 2018-10-08 15:57:30 -04:00
Jeff
0c4709efdd Merge branch 'master' of ssh://github.com/loki-project/loki-network 2018-10-08 07:56:46 -04:00
Jeff
a1d1518bc0 update logging to use human readable time 2018-10-08 07:56:17 -04:00
Jeff Becker
291cc57395
revert 2018-10-07 11:29:36 -04:00
Jeff Becker
f03698fb33
add to queue 2018-10-07 10:32:54 -04:00
Jeff Becker
f1a303d4d9
locking 2018-10-07 10:23:02 -04:00
Jeff Becker
0a4da82780
remove line 2018-10-07 10:11:55 -04:00
Jeff Becker
0480df528c
fixes 2018-10-07 10:11:03 -04:00
Jeff Becker
95b097f9b7
multithreaded crypto (maybe) 2018-10-07 10:10:48 -04:00
despair86
3c13101beb clang-format 2018-10-06 12:04:52 -05:00
despair86
3c7b7f2176 overlapped io pending is NOT an error 2018-10-06 12:04:52 -05:00
despair86
31c8aee3c1 woooooooooooooo
lokinet on win32 is now live
and the server code is more stable than the client code
2018-10-06 12:04:51 -05:00
despair86
2326ad0339 added note 2018-10-06 12:04:51 -05:00
despair86
e98835ff5c debug 2018-10-06 12:04:50 -05:00
despair86
457d6fbaf6 rebase conflict 2018-10-06 12:04:50 -05:00
despair86
94c5f46d33 try fixing win32 event loop 2018-10-06 12:04:50 -05:00
despair86
6ba60093d2 switch to std::variant for win32 ev_io
- sockets are a distinct (non-negative) file descriptor
- plain old file descriptors are opaque handles

this makes the specialisations of llarp::ev_io on win32 type-safe as
- TAP-Windows v9 adapter is a plain old device file (same as on UNIX and Linux)
- UDP listeners are sockets, so the type must change (from signed to unsigned int) to accomodate Winsock2
2018-10-06 12:04:49 -05:00
despair86
ca0d09142a Finally put together some skeletal TUN code for NT
up next: debugging the windows client code
stretch goal: prototype hosting a full masternode on Windows Server (still _highly_ experimental when it _does_ appear)
2018-10-06 12:04:48 -05:00
Jeff
11753f5d7e clarification for path transfer 2018-10-06 12:37:54 -04:00
Jeff
56d07ea700 try fix, dont use me 2018-10-06 12:21:45 -04:00
Jeff
a1fd9a0f93 don't publish every build 2018-10-06 12:09:37 -04:00
Jeff
78e601807d fix 2018-10-06 12:04:46 -04:00
Jeff
9a60c08810 only publish when we have at least 3 established paths 2018-10-06 12:03:54 -04:00
Jeff
e5208b65cc mark session active 2018-10-06 11:41:24 -04:00
Jeff
a0317e1430 remove logging 2018-10-06 11:10:02 -04:00
Jeff Becker
848f5c3059
make it compile 2018-10-05 11:05:52 -04:00
Ryan Tharp
57fccaf2e6
ShouldCreateDefaultHiddenService(), auto mode for defaultIfAddr & defaultIfName, favor llarp::Addr, guards, NAT with no bindings fix, actually name ifname set ifname 2018-10-05 11:02:58 -04:00
Jeff Becker
832e1849b2
remove log and swap intros 2018-10-04 14:15:22 -04:00
Jeff Becker
98df3b09f2
only use good routers 2018-10-04 13:51:45 -04:00
Jeff Becker
ab306b70bb
try closing session correctly 2018-10-04 13:41:23 -04:00
Jeff Becker
d71f0db2a5
more vigorous profiling 2018-10-04 13:34:26 -04:00
Jeff Becker
746e95994e
stricter profiling and better handover 2018-10-04 12:48:26 -04:00
Jeff Becker
a8f7a26c00
fix timestamps 2018-10-04 11:36:46 -04:00
Jeff Becker
1146bb34ac
make dns work 2018-10-04 11:34:31 -04:00
Ryan Tharp
6738fcaa6a
make sure iptracker is configured on start 2018-10-04 11:20:52 -04:00
Ryan Tharp
1efb68e9cd
pass tracker into dns_iptracker_setup 2018-10-04 11:20:34 -04:00
Ryan Tharp
bd1a25856e Merge branch 'master' of https://github.com/neuroscr/loki-network 2018-10-04 07:14:06 -07:00
Ryan Tharp
e09c80e7e9 make sure iptracker is configured on start 2018-10-04 07:10:42 -07:00
Ryan Tharp
f101dba662 fix refactor typo 2018-10-04 07:10:28 -07:00
Ryan Tharp
27afd392f2 pass tracker into dns_iptracker_setup 2018-10-04 07:10:09 -07:00
Jeff Becker
497c8c7d66
fix config 2018-10-04 09:56:06 -04:00
Jeff Becker
13a9ff7e5a
make configs generate sane defaults 2018-10-04 09:55:29 -04:00
Jeff Becker
a07b9b18d1
fix segfault 2018-10-04 09:21:05 -04:00
Jeff Becker
b724cc54fe
Merge remote-tracking branch 'ryan/master' 2018-10-04 09:04:57 -04:00
Jeff Becker
f19f78b573
try better handover logic 2018-10-04 09:03:48 -04:00
Jeff Becker
a3001dfe1d
fix timestamps, revert to old behavior 2018-10-04 09:02:03 -04:00
Ryan Tharp
f4c5999852 Merge branch 'master' of https://github.com/loki-project/loki-network 2018-10-03 11:46:24 +00:00
Jeff Becker
0b0278a312
we don't use crypto_async anymore 2018-10-03 07:02:56 -04:00
Ryan Tharp
bcbaf47adf ShouldCreateDefaultHiddenService(), auto mode for defaultIfAddr & defaultIfName, favor llarp::Addr, guards, NAT with no bindings fix, actually name ifname set ifname 2018-10-03 04:01:42 -07:00
Ryan Tharp
cc42e8e623 guard, rename endpoint to context, main_router_endpoint_iterator() implementation 2018-10-03 04:00:47 -07:00
Jeff Becker
8f98ef3e28
forgot file 2018-10-03 07:00:30 -04:00
Ryan Tharp
604c44e191 use llarp::Addr, added some guards 2018-10-03 03:59:49 -07:00
Jeff Becker
1f02498fc0
code for disabling default hidden service 2018-10-03 06:59:30 -04:00
Ryan Tharp
6bfd55f3f4 fix headers, clang-format, favor llarp::Addr 2018-10-03 03:54:12 -07:00
Ryan Tharp
f032a83e37 use llarp::Addr to store local private ip 2018-10-03 03:52:00 -07:00
Ryan Tharp
c40d5f4c4d notes and guard 2018-10-03 03:49:57 -07:00
Ryan Tharp
a0082e95bb change dll from tunEndpoint to router hidden service context, const some unchanging ptrs, use llarp::Addr more 2018-10-03 03:48:31 -07:00
Ryan Tharp
8f32f357c2 hasEndpoints(), mapAddressAll_context(), iterate(), MappAddressAllIter() 2018-10-03 03:44:58 -07:00
Ryan Tharp
429927187a refactored detect into net.cpp, clang-format 2018-10-03 03:42:44 -07:00
Ryan Tharp
a0aa363365 doesn't make sense to pass by value 2018-10-03 03:42:12 -07:00
Ryan Tharp
ec2aaa533f pretty sure this a clang-format 2018-10-03 03:40:32 -07:00
Ryan Tharp
48d9a38534 getSockAddr(), findFreePrivateRange(), findFreeLokiTunIfName() 2018-10-03 03:35:39 -07:00
Ryan Tharp
ce02a37b1c clang-format 2018-10-03 03:33:28 -07:00
Ryan Tharp
4b3b09736b Merge branch 'master' of https://github.com/loki-project/loki-network 2018-10-02 23:11:44 +00:00
Jeff
acc03fcad7 add default hidden service endpoint for clients 2018-10-02 13:35:51 -04:00
Jeff
b7eea47336 fall through 2018-10-02 11:41:40 -04:00
Jeff
a9eeb7fed9 meh 2018-10-02 11:33:01 -04:00
Jeff
1d41d93fd0 fix linux 2018-10-02 11:32:07 -04:00
Jeff
77b2903bda logging and add DST awareness to timestamps 2018-10-02 11:29:37 -04:00
Jeff
f3d446dafb handover logic fix, remove and add logging 2018-10-02 11:00:34 -04:00
Jeff
dbeead03f3 fix kqueue build 2018-10-02 10:29:46 -04:00
despair86
991c1d8fce fix 2018-10-01 15:19:26 -05:00
despair86
19b7f47322 bug: if we have only one network interface, then terminate the linked list with nullptr
otherwise, the windows build will crash
2018-10-01 15:08:56 -05:00
despair86
9fdde65798 make bencode ILP32/LLP64 clean (long is 32 bits outside of unix!)
actually open new RCs in binary mode
clang-format
win32 skeleton code for tun (still working on the guts)
2018-10-01 15:08:55 -05:00
despair86
8ac7d4f6dc if we didn't specify a path to save our config in, only create .lokinet on the assumption that $HOME or $APPDATA (on NT) already exist
add win32 tun glue, fix llarp timebase
(In fact, _both_ of these are guaranteed to exist on their respective platforms.)
also, tuntap is now wired up to the windows port
2018-10-01 15:08:52 -05:00
despair86
7f809eb53b fix windows build 2018-10-01 15:06:07 -05:00
despair86
7c5d98ca31 clean up win32 build rules 2018-10-01 15:06:06 -05:00
Jeff Becker
0f7c7c871f
reduce log levels and don't establish outbound send context for previously made inbound sessions 2018-10-01 14:10:25 -04:00
Jeff Becker
23cff0bee3
try fixing all that tun shit, YOLO 2018-10-01 13:16:15 -04:00
Jeff Becker
8aa0d0d4a8
try fixing tun writing 2018-10-01 13:05:36 -04:00
Jeff Becker
9e8563a884
cache convo tag and drop traffic 2018-10-01 11:45:55 -04:00
Jeff Becker
1eef5387b6
update introset on message drop 2018-10-01 10:31:54 -04:00
Jeff Becker
681e669fd8
try better publish logic and timeouts for requests 2018-10-01 10:18:17 -04:00
Ryan Tharp
4cc482764d clang format 2018-10-01 03:00:11 -07:00
Ryan Tharp
fb9b60bd16 clang-format 2018-10-01 02:57:57 -07:00
Ryan Tharp
e890ef2e5b ensure_config split router/client refactor, move C++ stuff to .hpp 2018-10-01 02:56:14 -07:00
Ryan Tharp
058ed4d4ea Merge branch 'master' of https://github.com/neuroscr/loki-network 2018-10-01 09:03:31 +00:00
Jeff
4158e422bb don't store introsets when forwarding a request 2018-09-30 12:02:42 -04:00
Jeff
a168c81a75 make mac tun work 2018-09-30 11:40:34 -04:00
Jeff
e50cbf5acb Merge branch 'master' of ssh://github.com/loki-project/loki-network 2018-09-30 11:25:59 -04:00
Jeff Becker
f6c812a642
include packet info in tun but discard it so that tun can work on platforms
that include packet info
2018-09-30 09:23:37 -04:00