summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp6-lease.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-09-24 03:49:14 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-09-29 15:29:40 +0900
commitb27dcf081382d06decc657ed8c985cf071ad5c75 (patch)
tree5c29c9d54037be265df68764161fa8998298663b /src/libsystemd-network/sd-dhcp6-lease.c
parentad3c84204c76e03a0b9b761563f6cd8907515014 (diff)
downloadsystemd-b27dcf081382d06decc657ed8c985cf071ad5c75.tar.gz
sd-dhcp6-client: slightly modernize dhcp6_option_parse_domainname()/domainname_list()
Diffstat (limited to 'src/libsystemd-network/sd-dhcp6-lease.c')
-rw-r--r--src/libsystemd-network/sd-dhcp6-lease.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c
index 9c77b146c7..3f416d6c6d 100644
--- a/src/libsystemd-network/sd-dhcp6-lease.c
+++ b/src/libsystemd-network/sd-dhcp6-lease.c
@@ -223,12 +223,12 @@ int dhcp6_lease_set_domains(sd_dhcp6_lease *lease, uint8_t *optval,
assert_return(lease, -EINVAL);
assert_return(optval, -EINVAL);
- if (!optlen)
+ if (optlen == 0)
return 0;
r = dhcp6_option_parse_domainname_list(optval, optlen, &domains);
if (r < 0)
- return 0;
+ return r;
strv_free_and_replace(lease->domains, domains);
lease->domains_count = r;
@@ -283,7 +283,7 @@ int dhcp6_lease_set_ntp(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen) {
r = dhcp6_option_parse_domainname_list(subval, sublen, &servers);
if (r < 0)
- return 0;
+ return r;
strv_free_and_replace(lease->ntp_fqdn, servers);
lease->ntp_fqdn_count = r;