1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

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

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: