Skip to content

Commit

Permalink
2 bug fixes for tolerances on server side (#159)
Browse files Browse the repository at this point in the history
* Don't process latency tolerance if it's turned off

* Only reject unauthenticated connections

* Adding latency tolerance limits

* Fixing mistake in rebase
  • Loading branch information
stevenleadbeater authored Aug 14, 2021
1 parent 03200ff commit 8aa1b16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mlvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ mlvpn_rtun_read(EV_P_ ev_io *w, int revents)

if ((tun->addrinfo->ai_addrlen != addrlen) ||
(memcmp(tun->addrinfo->ai_addr, &clientaddr, addrlen) != 0)) {
if (mlvpn_options.cleartext_data && tun->status >= MLVPN_AUTHOK) {
if (! tun->status >= MLVPN_AUTHOK) {
log_warnx("protocol", "%s rejected non authenticated connection",
tun->name);
return;
Expand Down Expand Up @@ -1210,6 +1210,9 @@ mlvpn_rtun_check_lossy(mlvpn_tunnel_t *tun)
static void
mlvpn_rtun_check_slow(mlvpn_tunnel_t *tun)
{
if(tun->latency_tolerence == 1000) {
return;
}
int status_changed = 0;
if (tun->srtt >= tun->latency_tolerence) {
log_info("rtt", "%s latency reached threashold: %fms/%dms",
Expand Down

0 comments on commit 8aa1b16

Please sign in to comment.