]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp6-client: slightly shorten dhcp6_option_append_fqdn()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 1 Oct 2022 06:44:02 +0000 (15:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 2 Oct 2022 14:05:05 +0000 (23:05 +0900)
src/libsystemd-network/dhcp6-option.c

index de54c36a71beebcd50cf3a289816977d2ef9913d..f257c56681aba8930485d2f5461986ddd70fb68a 100644 (file)
@@ -378,7 +378,7 @@ int dhcp6_option_append_fqdn(uint8_t **buf, size_t *buflen, const char *fqdn) {
         buffer[0] = DHCP6_FQDN_FLAG_S; /* Request server to perform AAAA RR DNS updates */
 
         /* Store domain name after flags field */
-        r = dns_name_to_wire_format(fqdn, buffer + 1, sizeof(buffer) - 1,  false);
+        r = dns_name_to_wire_format(fqdn, buffer + 1, sizeof(buffer) - 1, false);
         if (r <= 0)
                 return r;
 
@@ -391,9 +391,7 @@ int dhcp6_option_append_fqdn(uint8_t **buf, size_t *buflen, const char *fqdn) {
         if (dns_name_is_single_label(fqdn))
                 r--;
 
-        r = dhcp6_option_append(buf, buflen, SD_DHCP6_OPTION_CLIENT_FQDN, 1 + r, buffer);
-
-        return r;
+        return dhcp6_option_append(buf, buflen, SD_DHCP6_OPTION_CLIENT_FQDN, 1 + r, buffer);
 }
 
 int dhcp6_option_append_user_class(uint8_t **buf, size_t *buflen, char * const *user_class) {