|
|
@ -130,7 +130,7 @@ namespace data |
|
|
|
leases += 4; // tunnel ID
|
|
|
|
leases += 4; // tunnel ID
|
|
|
|
lease.endDate = bufbe64toh (leases); |
|
|
|
lease.endDate = bufbe64toh (leases); |
|
|
|
leases += 8; // end date
|
|
|
|
leases += 8; // end date
|
|
|
|
if (ts < lease.endDate) |
|
|
|
if (ts < lease.endDate + LEASE_ENDDATE_THRESHOLD) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (lease.endDate > m_ExpirationTime) |
|
|
|
if (lease.endDate > m_ExpirationTime) |
|
|
|
m_ExpirationTime = lease.endDate; |
|
|
|
m_ExpirationTime = lease.endDate; |
|
|
@ -151,7 +151,7 @@ namespace data |
|
|
|
else |
|
|
|
else |
|
|
|
LogPrint (eLogWarning, "LeaseSet: Lease is expired already "); |
|
|
|
LogPrint (eLogWarning, "LeaseSet: Lease is expired already "); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!m_ExpirationTime) |
|
|
|
if (!m_ExpirationTime && m_Leases.empty ()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint (eLogWarning, "LeaseSet: all leases are expired. Dropped"); |
|
|
|
LogPrint (eLogWarning, "LeaseSet: all leases are expired. Dropped"); |
|
|
|
m_IsValid = false; |
|
|
|
m_IsValid = false; |
|
|
@ -192,6 +192,12 @@ namespace data |
|
|
|
if (ts < endDate) |
|
|
|
if (ts < endDate) |
|
|
|
leases.push_back (it); |
|
|
|
leases.push_back (it); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (leases.empty () && withThreshold) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (auto it: m_Leases) |
|
|
|
|
|
|
|
if (ts < it->endDate + LEASE_ENDDATE_THRESHOLD) |
|
|
|
|
|
|
|
leases.push_back (it); |
|
|
|
|
|
|
|
} |
|
|
|
return leases; |
|
|
|
return leases; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|