From nobody Mon Feb 9 07:19:36 2026 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C33C2F0C7F for ; Fri, 9 Jan 2026 12:13:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767960791; cv=none; b=IJCeSBf7NeJ2BPBjdv+ezagBTFcQfsxya140I6TA+mqG9IqFsBH+OxdM7bIiJrSVwOaptftsw5YrPUTnZguGOssqw4r0G4wwUduwNtq2LAAf93eJdR/SJx8jeAX4d6N71cPi6IHRpCMiIWE2Gyep/6iaDlwEehAz49sWyJwSyWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767960791; c=relaxed/simple; bh=0yIboiZ8laNJ/CNq79lvdYNX16Y4FwxBgDWahMAFWsI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=n7B7HubZpN29LfZRCEqFCqP0+/hCD2aODlCWULTn/ExOC1zivqGxZs+nWXnbXli4ICM9uwfpCur3YwppX2Pvbg3vhsWdIX7T7B4U1pi+JpxYUzQAIy0542UAiTkyF2uZA7YeLYOUfXQrUMwdUYdmpQWl8wnbYAms2VhDq+Luu+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gIHmK+AR; arc=none smtp.client-ip=95.215.58.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gIHmK+AR" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767960787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EETQ3C2Ap/oA0jEy2/KTMPkQ1GCOoyHzuFkFxZNtMb8=; b=gIHmK+AR693tXzNTKjXokpseT5ImWVGflJPzyf7iM6EvDZ0XU4K6aItdnleZuNziD3t5HK hptCgc1ZaE9xz6vyuiqerswDansfn3niL4ajhMmpyBg6rKGBpwwMF3rSavh3mWcZWki6Yl R6d6b1JsaaqVwMfczgZNExdV7WIzmg4= From: Thorsten Blum To: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: Thorsten Blum , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2] net: ipconfig: Remove outdated comment and indent code block Date: Fri, 9 Jan 2026 13:11:29 +0100 Message-ID: <20260109121128.170020-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" 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 --- Changes in v2: - Move const definition to the top (Paolo) - Format ternary expression - Link to v1: https://lore.kernel.org/lkml/20251220130335.77220-1-thorsten.= blum@linux.dev/ --- net/ipv4/ipconfig.c | 89 +++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 019408d3ca2c..b1e1be00ff8b 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -679,8 +679,18 @@ static const u8 ic_bootp_cookie[4] =3D { 99, 130, 83, = 99 }; static void __init ic_dhcp_init_options(u8 *options, struct ic_device *d) { - u8 mt =3D ((ic_servaddr =3D=3D NONE) - ? DHCPDISCOVER : DHCPREQUEST); + static const u8 ic_req_params[] =3D { + 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 =3D (ic_servaddr =3D=3D NONE) ? DHCPDISCOVER : DHCPREQUEST; u8 *e =3D options; int len; =20 @@ -705,51 +715,36 @@ ic_dhcp_init_options(u8 *options, struct ic_device *d) e +=3D 4; } =20 - /* always? */ - { - static const u8 ic_req_params[] =3D { - 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++ =3D 55; /* Parameter request list */ - *e++ =3D sizeof(ic_req_params); - memcpy(e, ic_req_params, sizeof(ic_req_params)); - e +=3D sizeof(ic_req_params); - - if (ic_host_name_set) { - *e++ =3D 12; /* host-name */ - len =3D strlen(utsname()->nodename); - *e++ =3D len; - memcpy(e, utsname()->nodename, len); - e +=3D len; - } - if (*vendor_class_identifier) { - pr_info("DHCP: sending class identifier \"%s\"\n", - vendor_class_identifier); - *e++ =3D 60; /* Class-identifier */ - len =3D strlen(vendor_class_identifier); - *e++ =3D len; - memcpy(e, vendor_class_identifier, len); - e +=3D len; - } - len =3D 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 >=3D 1 && len < 312 - (e - options) - 1) { - *e++ =3D 61; - *e++ =3D len + 1; - memcpy(e, dhcp_client_identifier, len + 1); - e +=3D len + 1; - } + *e++ =3D 55; /* Parameter request list */ + *e++ =3D sizeof(ic_req_params); + memcpy(e, ic_req_params, sizeof(ic_req_params)); + e +=3D sizeof(ic_req_params); + + if (ic_host_name_set) { + *e++ =3D 12; /* host-name */ + len =3D strlen(utsname()->nodename); + *e++ =3D len; + memcpy(e, utsname()->nodename, len); + e +=3D len; + } + if (*vendor_class_identifier) { + pr_info("DHCP: sending class identifier \"%s\"\n", + vendor_class_identifier); + *e++ =3D 60; /* Class-identifier */ + len =3D strlen(vendor_class_identifier); + *e++ =3D len; + memcpy(e, vendor_class_identifier, len); + e +=3D len; + } + len =3D 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 >=3D 1 && len < 312 - (e - options) - 1) { + *e++ =3D 61; + *e++ =3D len + 1; + memcpy(e, dhcp_client_identifier, len + 1); + e +=3D len + 1; } =20 *e++ =3D 255; /* End of the list */ --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4