]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: use consistent type when parsing lifetimes
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 May 2020 06:17:45 +0000 (08:17 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 25 May 2020 12:52:00 +0000 (14:52 +0200)
Those fields are both uint32_t, so we should use the same type when parsing.
Having a different type didn't change the result, but let's be consistent.

src/network/networkd-address.c
src/network/networkd-dhcp4.c

index 1567bd7ee9112b7db9d5c4e4f73514cc3d80da93..f9bbd05dd8ba81e7f622fb4d42ac851e7e8f7bc7 100644 (file)
@@ -954,7 +954,7 @@ int config_parse_lifetime(const char *unit,
                           void *userdata) {
         Network *network = userdata;
         _cleanup_(address_free_or_set_invalidp) Address *n = NULL;
-        unsigned k;
+        uint32_t k;
         int r;
 
         assert(filename);
@@ -979,7 +979,7 @@ int config_parse_lifetime(const char *unit,
         }
 
         n->cinfo.ifa_prefered = k;
-        n = NULL;
+        TAKE_PTR(n);
 
         return 0;
 }
index 42e6b5aef2a9aad329cd19ca416f90ffd1ebf5d1..8e2c775fcf420418faa0d9c383c7f49fda091d66 100644 (file)
@@ -1691,7 +1691,7 @@ int config_parse_dhcp_fallback_lease_lifetime(const char *unit,
                 void *data,
                 void *userdata) {
         Network *network = userdata;
-        unsigned k;
+        uint32_t k;
 
         assert(filename);
         assert(section);