From c5bc3091ccb62748a243e31b836903cedee9711d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 23 Jan 2022 11:31:20 -0600 Subject: [PATCH] fixup! NAT-PMP private/public port and lifetime fix (#1602) (#2482) ensure the value passed to tr_timerAdd() is non-negative --- libtransmission/port-forwarding.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/port-forwarding.cc b/libtransmission/port-forwarding.cc index dd42b3386..0bd71146a 100644 --- a/libtransmission/port-forwarding.cc +++ b/libtransmission/port-forwarding.cc @@ -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: