fixup! NAT-PMP private/public port and lifetime fix (#1602) (#2482)

ensure the value passed to tr_timerAdd() is non-negative
This commit is contained in:
Charles Kerr 2022-01-23 11:31:20 -06:00 committed by GitHub
parent fa3cbc3e27
commit c5bc3091cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ static void set_evtimer_from_status(tr_shared* s)
/* if we're mapped, everything is fine... check back at renew_time
* to renew the port forwarding if it's expired */
s->doPortCheck = true;
sec = int(s->natpmp->renew_time - tr_time());
sec = std::max(0, int(s->natpmp->renew_time - tr_time()));
break;
case TR_PORT_ERROR: