]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libvirt_nss: Pass @name to appendAddr()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Jul 2019 08:34:53 +0000 (10:34 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Jul 2019 11:48:19 +0000 (13:48 +0200)
In the nss plugin we have ERROR() macro which by default does
nothing. However, at compile time it can be made to report errors
(this is useful for debugging because by nature of NSS debugging
is hard). Anyway, the appendAddr() function uses @name (which
contains name the caller wants us to resolve) for error
reporting. But the caller findLeaseInJSON() is not passing it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
tools/nss/libvirt_nss.c

index 3b2583669bdc4caa0bdb8703d5b368f188ac12e1..b0e118bf371b659ce6a4c946a74f2764d286e4ad 100644 (file)
@@ -80,7 +80,8 @@ typedef struct {
 
 
 static int
-appendAddr(leaseAddress **tmpAddress,
+appendAddr(const char *name ATTRIBUTE_UNUSED,
+           leaseAddress **tmpAddress,
            size_t *ntmpAddress,
            virJSONValuePtr lease,
            int af)
@@ -196,7 +197,7 @@ findLeaseInJSON(leaseAddress **tmpAddress,
         DEBUG("Found record for %s", name);
         *found = true;
 
-        if (appendAddr(tmpAddress, ntmpAddress, lease, af) < 0)
+        if (appendAddr(name, tmpAddress, ntmpAddress, lease, af) < 0)
             return -1;
     }