From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E5B6C1FFC48 for ; Wed, 30 Sep 2026 02:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790735923; cv=none; b=Fe4F9ht0WSW1pzupSvJKMlJfa7OGN5af//D7TYbE32yvqFm2JBR7Xn6nN8wiDcfW5bAPDcoDMk/3+9l5BCLQCW5WWwEQZz2KJsVKWfb0dQQpAXvhAG6JnlyZCNHCobSbbZ9zCDHkFWDTXxTgMwQ2WvWk47cOco7Vg4gi2y4Btg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790735923; c=relaxed/simple; bh=BL4oOvXvikHFmuQ9lf1hZJPoIVHcFB4agdui+L4oDyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nirnmhiuIAMYU1OLRKA0HqhWZynU4K9dXDOQ1Wjjm8RFOb5++G6ssrQb9D+1IstDkGHpRQNpnUPE/J6bjU+qdAqINEOO/gTh7P3rKkzQNggXp4BdpvLeCheXgJkIfx3RvtB5ekbo19/G/drFw8rwFHkgxb8PW1jWqCUYftrlWsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FQDDlo+W; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FQDDlo+W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07EB61F000FF; Wed, 30 Sep 2026 02:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790735921; bh=Qw3dwEn61Ptf7/liuqJc2eT5MrzSRzii1QCewhzCVQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FQDDlo+Wse4ddqSy3GVBjJn0BYcBPdStYgdXiJrswiCMNpvVglAkMAR7S9EWi1RJ5 yyTpIfFJE7eCZh8r/zoPu82SJB3wsnPJrG8WLVAZ07VmXI/tQjQpgJ9P/GRX+XMLr9 OYSKjt8FhHgMz81sj3fmpW8hnZ61pKs80yl9Morv+mFml9vAGFAu4DxUpwNmMdxcz6 vT/S5y8VQsWMkdkigG7j2cxIxjn3bjRek8uDarpM5NSeO5VjZG8psFHcyLmRIjSb+f 7ByyM6cTqzMkRciXuBHEE6CfpUpRbpvSNwiUAz8fOAhbfgoGORb28pqsMQjiB6qh0T cTfFARSd/VHaA== From: Sasha Levin To: stable@vger.kernel.org Cc: Thorsten Blum , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10.y 1/2] net: ipconfig: Remove outdated comment and indent code block Date: Tue, 29 Sep 2026 22:38:38 -0400 Message-ID: <20260930023839.3438256-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026092954-module-canary-801f@gregkh> References: <2026092954-module-canary-801f@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Thorsten Blum [ Upstream commit e405b3c9d4aaa10972525fe2ea5cf94224020561 ] 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 Link: https://patch.msgid.link/20260109121128.170020-2-thorsten.blum@linux.dev Signed-off-by: Jakub Kicinski Stable-dep-of: e47a1958e12a ("net: ipconfig: bound DHCP option construction") Signed-off-by: Sasha Levin --- 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 213a1c91507d9..986d469651d2e 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -652,8 +652,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; @@ -678,51 +688,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 */ -- 2.53.0