@@ -80,7 +80,7 @@ namespace llarp::handlers
80
80
path::PathHandler::tick (now);
81
81
}
82
82
83
- bool SessionEndpoint::stop (bool send_close)
83
+ void SessionEndpoint::stop (bool send_close)
84
84
{
85
85
log ::trace (logcat, " {} called" , __PRETTY_FUNCTION__);
86
86
@@ -98,7 +98,6 @@ namespace llarp::handlers
98
98
99
99
_router.loop ()->call ([&]() mutable {
100
100
_sessions.for_each ([](std::shared_ptr<session::BaseSession>& s) { s->send_path_close (); });
101
-
102
101
prom.set_value ();
103
102
});
104
103
@@ -108,7 +107,7 @@ namespace llarp::handlers
108
107
109
108
_sessions.clear_sessions ();
110
109
111
- return path::PathHandler::stop ();
110
+ path::PathHandler::stop ();
112
111
}
113
112
114
113
void SessionEndpoint::configure ()
@@ -132,18 +131,18 @@ namespace llarp::handlers
132
131
client_contact.SRVs = _srv_records;
133
132
}
134
133
135
- if (use_tokens = not net_config.auth_static_tokens .empty (); use_tokens )
134
+ if (_use_tokens = not net_config.auth_static_tokens .empty (); _use_tokens )
136
135
_static_auth_tokens.merge (net_config.auth_static_tokens );
137
136
138
- if (use_whitelist = not net_config.auth_whitelist .empty (); use_whitelist )
137
+ if (_use_whitelist = not net_config.auth_whitelist .empty (); _use_whitelist )
139
138
_auth_whitelist.merge (net_config.auth_whitelist );
140
139
141
140
_if_name = *net_config._if_name ;
142
141
_local_range = *net_config._local_ip_range ;
143
142
_local_addr = *net_config._local_addr ;
144
143
_local_base_ip = *net_config._local_base_ip ;
145
144
146
- _is_v4 = _local_range. is_ipv4 () ;
145
+ _ipv6_enabled = net_config. enable_ipv6 ;
147
146
148
147
// TESTNET: TODO: check if ipv6 is disabled
149
148
for (auto & [addr, range] : net_config._exit_ranges )
@@ -159,8 +158,9 @@ namespace llarp::handlers
159
158
// always accept ipv4 (currently)
160
159
uint8_t protoflags = meta::to_underlying (protocol_flag::IPV4);
161
160
162
- if (!_is_v4 )
161
+ if (_ipv6_enabled )
163
162
protoflags |= meta::to_underlying (protocol_flag::IPV6);
163
+
164
164
// if we are a full client, we accept standard and tunneled (QUICTUN) traffic
165
165
if (_router.using_tun_if ())
166
166
protoflags |= meta::to_underlying (protocol_flag::QUICTUN);
@@ -192,7 +192,7 @@ namespace llarp::handlers
192
192
193
193
void SessionEndpoint::rotate_paths ()
194
194
{
195
- log ::debug (logcat, " {} called" , __PRETTY_FUNCTION__);
195
+ log ::trace (logcat, " {} called" , __PRETTY_FUNCTION__);
196
196
197
197
Lock_t l{paths_mutex};
198
198
@@ -208,6 +208,7 @@ namespace llarp::handlers
208
208
[this ](auto new_path) mutable {
209
209
path_build_succeeded (new_path);
210
210
drop_oldest_path ();
211
+ log ::info (logcat, " SessionEndpoint successfully rotated in new path: {}" , new_path->to_string ());
211
212
update_and_publish_localcc ();
212
213
},
213
214
[this ](auto new_path, int ec) mutable { path_build_failed (std::move (new_path), ec); });
@@ -240,17 +241,11 @@ namespace llarp::handlers
240
241
size_t count{0 };
241
242
log ::debug (logcat, " SessionEndpoint building {} paths to random remotes (needed: {})" , n, num_paths_desired);
242
243
243
- // TESTNET: ensure one path is built to pivot
244
- // RouterID pivot{oxenc::from_base32z("55fxrybf3jtausbnmxpgwcsz9t8qkf5pr8t5f4xyto4omjrkorpy")};
245
- // count += build_path_aligned_to_remote(pivot);
246
-
247
244
while (count < n)
248
245
count += build_path_to_random ();
249
246
250
247
if (count == n)
251
- {
252
248
log ::debug (logcat, " SessionEndpoint successfully initiated {} path-builds" , n);
253
- }
254
249
else
255
250
log ::warning (logcat, " SessionEndpoint only initiated {} path-builds (needed: {})" , count, n);
256
251
}
@@ -270,7 +265,12 @@ namespace llarp::handlers
270
265
_router.loop ()->call_later (approximate_time (5s, 5 ), [&]() {
271
266
update_and_publish_localcc ();
272
267
_cc_publisher = _router.loop ()->call_every (
273
- CC_PUBLISH_INTERVAL, [this ]() mutable { update_and_publish_localcc (); }, true );
268
+ CC_PUBLISH_INTERVAL,
269
+ [/* this */ ]() mutable {
270
+ log ::critical (logcat, " TESTNET: Skipping ClientContact publish!" );
271
+ // update_and_publish_localcc();
272
+ },
273
+ true );
274
274
});
275
275
}
276
276
else
@@ -523,10 +523,10 @@ namespace llarp::handlers
523
523
{
524
524
bool ret{true };
525
525
526
- if (use_tokens )
526
+ if (_use_tokens )
527
527
ret &= _static_auth_tokens.contains (*maybe_auth);
528
528
529
- if (use_whitelist )
529
+ if (_use_whitelist )
530
530
ret &= _auth_whitelist.contains (remote);
531
531
532
532
return ret;
0 commit comments