]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: drop redundant condition
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 May 2023 15:27:22 +0000 (00:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 May 2023 15:27:24 +0000 (00:27 +0900)
Closes #27561.

src/libsystemd-network/sd-dhcp-client.c

index f207cf0c1e9175e91df0d358b3c6b5e070f10032..b73abcb82d162dbee743a3c29dd3b1fe91df2060 100644 (file)
@@ -828,14 +828,12 @@ static int client_message_init(
 
         /* Some DHCP servers will refuse to issue an DHCP lease if the Client
            Identifier option is not set */
-        if (client->client_id_len) {
-                r = dhcp_option_append(&packet->dhcp, optlen, &optoffset, 0,
-                                       SD_DHCP_OPTION_CLIENT_IDENTIFIER,
-                                       client->client_id_len,
-                                       &client->client_id);
-                if (r < 0)
-                        return r;
-        }
+        r = dhcp_option_append(&packet->dhcp, optlen, &optoffset, 0,
+                               SD_DHCP_OPTION_CLIENT_IDENTIFIER,
+                               client->client_id_len,
+                               &client->client_id);
+        if (r < 0)
+                return r;
 
         /* RFC2131 section 3.5:
            in its initial DHCPDISCOVER or DHCPREQUEST message, a