From patchwork Fri Jan 28 08:40:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Kalb X-Patchwork-Id: 1585741 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sma.de header.i=@sma.de header.a=rsa-sha256 header.s=selector2 header.b=n8nMBSu0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jlhpv6WZcz9t56 for ; Sat, 29 Jan 2022 02:54:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12EC8820FE; Fri, 28 Jan 2022 16:54:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sma.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=sma.de header.i=@sma.de header.b="n8nMBSu0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B5EE7837C9; Fri, 28 Jan 2022 09:41:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0715.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::715]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E8662820F8 for ; Fri, 28 Jan 2022 09:41:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sma.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=svc.sw.rte.linux@sma.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+/QKF3/6cy6Pip7Idgf2uEg/rXZ1HkqoSYW0cK6zHXJ7yAhjD2CGRSGZthI5cSTK8A0abRTdWwW+ZkOKLw//pxSB2pCyi9MHr0xDrYE94VEEQHeSJuKhGodR7ZrUxQN6nQXAbeGt6l/zvfdAPq2+dqrXQbNvRkj9cJOapn5It3DxAIaMVxisJc+cNv0SOLHPBwiy7qIX4qL78nfHKEw6dTG+C5AiBBPiCOVef+T8uhVvg7xi1mecYG/Xz3EXAKpOuc0uiRa31xKC20moWIB7KUyqfXpDHqEJCiop5Ht1Kz5BUoFtZ+9TaSpj+pyUuDWERm421Ep/QQrWh3vDrDMSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AfSuiG06TcdIekttMIK1Hf6NpnF6vZM7ZXZbH/cQauA=; b=jTBplUEC5YjB8tS1cK4VJNG4UqjN5PMBwuE6Jh/QV+ENNOmM4SbNPLwfk1W0VDYvU3034yQEVZak1nmdd+2ALlH+P7lXS9gDBkSmqPtPl4yJm4INS522rZ145jmj036ZpupsqA2rUrJSho+aq618c1RaP/DpWvg8iH0U+jouQBtQavIUpHq3kg6Q01Hzc8XXnU0Vg3B8hnb4fEfDwYHZ6gw/QcIFaI9fDnqZ4sF9BvNxcTB6I1BAYoaz9ML9Kqc7PzYC1nUR75Ly87LIf52SFGb+tl1HGyxz5Tb76tFR/+9lItmenuXzaTaJLsdLV6jzTqpOmTrDRxXRG3LoFwouyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 194.176.121.59) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=sma.de; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=sma.de; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sma.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AfSuiG06TcdIekttMIK1Hf6NpnF6vZM7ZXZbH/cQauA=; b=n8nMBSu02dvPU2CzgCJXPk9+luR0geqd2JpfHnIYxCMN3VtcB47c/UTbvHS7QGo7YTwxLrzrhGZtig7NMQQyyEvsX0zPwTBILTs+/YccnwDick9CZ2jcdisBQ0XEl+SInBafhY7ys79FX8N2TIrYIhsgTSf1ZS88OMCym84wQno= Received: from AM5PR0402CA0005.eurprd04.prod.outlook.com (2603:10a6:203:90::15) by DB9PR04MB9404.eurprd04.prod.outlook.com (2603:10a6:10:368::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Fri, 28 Jan 2022 08:41:05 +0000 Received: from VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com (2603:10a6:203:90:cafe::b9) by AM5PR0402CA0005.outlook.office365.com (2603:10a6:203:90::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17 via Frontend Transport; Fri, 28 Jan 2022 08:41:05 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 194.176.121.59) smtp.mailfrom=sma.de; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=sma.de; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning sma.de discourages use of 194.176.121.59 as permitted sender) Received: from webmail.sma.de (194.176.121.59) by VE1EUR02FT025.mail.protection.outlook.com (10.152.12.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4930.15 via Frontend Transport; Fri, 28 Jan 2022 08:41:05 +0000 Received: from SVR-DE-EXHYB-01.sma.de ([10.0.40.14]) by webmail.sma.de over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384); Fri, 28 Jan 2022 09:40:33 +0100 Received: from pc6682 (10.9.12.142) by SVR-DE-EXHYB-01.sma.de (10.0.40.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2176.2; Fri, 28 Jan 2022 09:40:33 +0100 Date: Fri, 28 Jan 2022 09:40:32 +0100 From: Andre Kalb To: Joe Hershberger , Ramon Fried , Subject: [PATCH] net: bootp: Make root path (option 17) length configurable Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Originating-IP: [10.9.12.142] X-ClientProxiedBy: SVR-DE-EXHYB-01.sma.de (10.0.40.14) To SVR-DE-EXHYB-01.sma.de (10.0.40.14) X-OriginalArrivalTime: 28 Jan 2022 08:40:33.0327 (UTC) FILETIME=[B6A6FBF0:01D81422] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da6fe0b5-24b9-49f9-21bb-08d9e239ec60 X-MS-TrafficTypeDiagnostic: DB9PR04MB9404:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UThtdhx6ZV/8l31g/1d9tO5zw4mG9KCdsJUY4UvRWEytmxFV5jtjGJrNFpap0xrrAH+af6ZIw+63irYbqbuqiyHOhEEJiZoWBia5wn3Km/Fepb54ogkU64K3E476jEZoBjXwY191/eYCv0dwRacq2Y8JpGgW0egtYqi7ctLLhz/TuVXEv+9zhIi65egriTWJPdoD3tJQzmVSJBjLK7DZh/oTaRPCUFqnIQwrHADSpfj/QwioWh7ygSlN2HQjJXRluxh/i4Jr3Q6YmYG9juhIyEdl3GB279e9jvCu+BGc4ZWN6EdrBKiyi3yHKQHDc1U6oFqaL6zYMntLKPnSn2LRI89t0AFwF9U4Yy64mUB4M9hO18qEcYHu9d+cfrZNq6YD1bHBK2LXHATs6iifcesTUgWslEfxUhk2r8uXPind8t7BW1KwZ81sXjnF71a554l+4LI/CRH/wZ1h8OFdo5qSsLbTgGH/jqkexiMkZ0Rh2RBtJB7ADmVm4YW8/iG/o09KzhdJMYCS/o15exhx5wxFjrnP+bBtvE8Z8TeMaZZiWiQA+hXzqE532KGzMp3bjMtVb4n5K+CDT/cG8BMTF3LLu1PfMnPPEOVo+QZgnpyyp0/74Dw/7CpBew9wN6/o3XAu6QUuxdSX/TZtDSBs4cRimR4QcAY/ozf8MMk7iGKSAbc9Kv2Wi+b+t2PlpCSec18Y7yDsWwBBrxoMQ11ao8nzTw== X-Forefront-Antispam-Report: CIP:194.176.121.59; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:webmail.sma.de; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(81166007)(356005)(2906002)(33716001)(83380400001)(16526019)(36860700001)(82310400004)(47076005)(26005)(55016003)(186003)(70586007)(70206006)(426003)(336012)(8676002)(5660300002)(8936002)(110136005)(9686003)(316002)(9576002)(86362001)(40460700003)(508600001)(36900700001)(20210929001); DIR:OUT; SFP:1102; X-OriginatorOrg: sma.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2022 08:41:05.5903 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da6fe0b5-24b9-49f9-21bb-08d9e239ec60 X-MS-Exchange-CrossTenant-Id: a059b96c-2829-4d11-8837-4cc1ff84735d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a059b96c-2829-4d11-8837-4cc1ff84735d; Ip=[194.176.121.59]; Helo=[webmail.sma.de] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9404 X-Mailman-Approved-At: Fri, 28 Jan 2022 16:54:20 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Andre Kalb Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean to adjust the root path length. Eg to 256 from Linux Kernel Signed-off-by: Andre Kalb Reviewed-by: Ramon Fried --- include/net.h | 2 +- net/Kconfig | 6 ++++++ net/bootp.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/net.h b/include/net.h index b02e4f630c..6f3f3dfcd4 100644 --- a/include/net.h +++ b/include/net.h @@ -540,7 +540,7 @@ extern struct in_addr net_dns_server2; #endif extern char net_nis_domain[32]; /* Our IS domain */ extern char net_hostname[32]; /* Our hostname */ -extern char net_root_path[64]; /* Our root path */ +extern char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN]; /* Our root path */ /** END OF BOOTP EXTENTIONS **/ extern u8 net_ethaddr[ARP_HLEN]; /* Our ethernet address */ extern u8 net_server_ethaddr[ARP_HLEN]; /* Boot server enet address */ diff --git a/net/Kconfig b/net/Kconfig index 2ae9d6a020..553e271ce9 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -123,4 +123,10 @@ config BOOTP_SERVERIP variable, not the BOOTP server. This affects the operation of both bootp and tftp. +config BOOTP_MAX_ROOT_PATH_LEN + int "Option 17 root path length" + default 64 + help + Select maximal length of option 17 root path. + endif # if NET diff --git a/net/bootp.c b/net/bootp.c index d83e4eb0ba..1566fc5495 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -64,7 +64,7 @@ ulong bootp_start; ulong bootp_timeout; char net_nis_domain[32] = {0,}; /* Our NIS domain */ char net_hostname[32] = {0,}; /* Our hostname */ -char net_root_path[64] = {0,}; /* Our bootpath */ +char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN] = {0,}; /* Our bootpath */ static ulong time_taken_max;