networkGetDHCPLeases: Handle leases with infinite expiry time

After v6.3.0-rc1~64 a lease can have infinite expiry time. This
means that the expiration time will appear as a value of zero.
Do the expiration check only if the expiration time is not zero.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1908053
Fixes: 97a0aa2467
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik 2020-12-18 16:09:15 +01:00
parent 5fb6d98c88
commit 5dd53684e1

View File

@ -4131,7 +4131,7 @@ networkGetDHCPLeases(virNetworkPtr net,
}
/* Do not report expired lease */
if (expirytime_tmp < currtime)
if (expirytime_tmp > 0 && expirytime_tmp < currtime)
continue;
if (need_results) {