]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
networkGetDHCPLeases: Handle leases with infinite expiry time
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 18 Dec 2020 15:09:15 +0000 (16:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Jan 2021 14:33:31 +0000 (15:33 +0100)
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: 97a0aa246799c97d0a9ca9ecd6b4fd932ae4756c
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/network/bridge_driver.c

index fcc7e05ad8ab3f6b877c4033cb15fc7790c25023..22d7d330a395e66601a9112da6f380d9278408fd 100644 (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) {