]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: ipconfig: Remove outdated comment and indent code block
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 9 Jan 2026 12:11:29 +0000 (13:11 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 Jan 2026 03:11:35 +0000 (19:11 -0800)
The comment has been around ever since commit 1da177e4c3f4
("Linux-2.6.12-rc2") and can be removed. Remove it and indent the code
block accordingly.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260109121128.170020-2-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/ipconfig.c

index 019408d3ca2cb13d952c866b4a841add74d8ea7d..b1e1be00ff8bb379bb5967489a1ba14d71f218e2 100644 (file)
@@ -679,8 +679,18 @@ static const u8 ic_bootp_cookie[4] = { 99, 130, 83, 99 };
 static void __init
 ic_dhcp_init_options(u8 *options, struct ic_device *d)
 {
-       u8 mt = ((ic_servaddr == NONE)
-                ? DHCPDISCOVER : DHCPREQUEST);
+       static const u8 ic_req_params[] = {
+               1,      /* Subnet mask */
+               3,      /* Default gateway */
+               6,      /* DNS server */
+               12,     /* Host name */
+               15,     /* Domain name */
+               17,     /* Boot path */
+               26,     /* MTU */
+               40,     /* NIS domain name */
+               42,     /* NTP servers */
+       };
+       u8 mt = (ic_servaddr == NONE) ? DHCPDISCOVER : DHCPREQUEST;
        u8 *e = options;
        int len;
 
@@ -705,51 +715,36 @@ ic_dhcp_init_options(u8 *options, struct ic_device *d)
                e += 4;
        }
 
-       /* always? */
-       {
-               static const u8 ic_req_params[] = {
-                       1,      /* Subnet mask */
-                       3,      /* Default gateway */
-                       6,      /* DNS server */
-                       12,     /* Host name */
-                       15,     /* Domain name */
-                       17,     /* Boot path */
-                       26,     /* MTU */
-                       40,     /* NIS domain name */
-                       42,     /* NTP servers */
-               };
-
-               *e++ = 55;      /* Parameter request list */
-               *e++ = sizeof(ic_req_params);
-               memcpy(e, ic_req_params, sizeof(ic_req_params));
-               e += sizeof(ic_req_params);
-
-               if (ic_host_name_set) {
-                       *e++ = 12;      /* host-name */
-                       len = strlen(utsname()->nodename);
-                       *e++ = len;
-                       memcpy(e, utsname()->nodename, len);
-                       e += len;
-               }
-               if (*vendor_class_identifier) {
-                       pr_info("DHCP: sending class identifier \"%s\"\n",
-                               vendor_class_identifier);
-                       *e++ = 60;      /* Class-identifier */
-                       len = strlen(vendor_class_identifier);
-                       *e++ = len;
-                       memcpy(e, vendor_class_identifier, len);
-                       e += len;
-               }
-               len = strlen(dhcp_client_identifier + 1);
-               /* the minimum length of identifier is 2, include 1 byte type,
-                * and can not be larger than the length of options
-                */
-               if (len >= 1 && len < 312 - (e - options) - 1) {
-                       *e++ = 61;
-                       *e++ = len + 1;
-                       memcpy(e, dhcp_client_identifier, len + 1);
-                       e += len + 1;
-               }
+       *e++ = 55;      /* Parameter request list */
+       *e++ = sizeof(ic_req_params);
+       memcpy(e, ic_req_params, sizeof(ic_req_params));
+       e += sizeof(ic_req_params);
+
+       if (ic_host_name_set) {
+               *e++ = 12;      /* host-name */
+               len = strlen(utsname()->nodename);
+               *e++ = len;
+               memcpy(e, utsname()->nodename, len);
+               e += len;
+       }
+       if (*vendor_class_identifier) {
+               pr_info("DHCP: sending class identifier \"%s\"\n",
+                       vendor_class_identifier);
+               *e++ = 60;      /* Class-identifier */
+               len = strlen(vendor_class_identifier);
+               *e++ = len;
+               memcpy(e, vendor_class_identifier, len);
+               e += len;
+       }
+       len = strlen(dhcp_client_identifier + 1);
+       /* the minimum length of identifier is 2, include 1 byte type,
+        * and can not be larger than the length of options
+        */
+       if (len >= 1 && len < 312 - (e - options) - 1) {
+               *e++ = 61;
+               *e++ = len + 1;
+               memcpy(e, dhcp_client_identifier, len + 1);
+               e += len + 1;
        }
 
        *e++ = 255;     /* End of the list */