From patchwork Fri Jun 15 08:29:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138662 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp549616lji; Fri, 15 Jun 2018 01:29:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLEYgD/mXM2raxQuaKEvZH2XxEn6CQhZHc8pMi0aMIFl3rHQ4JHiuieKE4l0vbF3CcjTV2v X-Received: by 2002:a50:863d:: with SMTP id o58-v6mr1042988edo.243.1529051399599; Fri, 15 Jun 2018 01:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529051399; cv=none; d=google.com; s=arc-20160816; b=cELtKNOV2IGP32RWVgWBGZwVD/0u1OJq4DU0WJ+jXrwXcVdIHa8vQtHfyHWssmNcsV 3y2f58PJNKD94hcruL6QyeG87Ei/y1Gc2Um9GC+HOF2dnM0hK3qsxrXf3JnMJwI4DrHa cdi9KmWMDwEixL0OCRjfZOa0HMsr5ZZqOIO6MySyM8+ZWoUKRelRz8Nqj83DqTg8NTuv UTF3sxR03J56Iq3d+RsRchvekh+s9YaSBLCzAWtLLUCzn1WxLwuxQCiXOBihMjcnKKVJ Ci5+nuS5I4dKt1sZE9bbM4xpgDnColy5FTjApQLlshWil+JyRp9kgMtn+1VDnHaZ9TDw XUcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :arc-authentication-results; bh=2S+pZ+sRhYwVexxADLi4FKtWhAYyZZh4tnR5LxL6Kn4=; b=GHQEcI83q2TExovDbvamrqIjt1LLTsRWXX/f5LpX20ug+KjinJkRt/0SGY7Aqe/2hm LSV+wD7COJQZ8FGlBps66UTzjjQ/zzmU/8q3lOVpNwxfqS9GuqjzrUb0RNI7mI6gknvl QEhIsUAsiPLMby/MR+nmd1vH64MDfnbY/QiW8zJiKVi/mG/jugZEKkws82moFexyhjUi yBlyuwlseJmW4qN6jTQff4PQR1pN+6LlLmk/QkvCOxVoj8bY92Ec2GLI2cq6jG8tuzoc PzGZ3/T9znYGAUaL3+FiI+W9VHzu9PJyd9JipLFfyBmdv8ODReKNt0VZ0LZcjAffGLMm MNuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id i91-v6si2170728edd.228.2018.06.15.01.29.59; Fri, 15 Jun 2018 01:29:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 140D2C21E1A; Fri, 15 Jun 2018 08:29:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EBBCEC21DFF; Fri, 15 Jun 2018 08:29:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C40E2C21D83; Fri, 15 Jun 2018 08:29:30 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 56903C21D83 for ; Fri, 15 Jun 2018 08:29:30 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 08520AD01; Fri, 15 Jun 2018 08:29:30 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Fri, 15 Jun 2018 10:29:26 +0200 Message-Id: <20180615082929.82491-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 Cc: Joe Hershberger , Rick Chen , greentime@andestech.com Subject: [U-Boot] [PATCH v3 0/3] net: Sanitize DHCP variable override X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" While trying to boot from network on a RISC-V AX25 platform, I saw that the DHCP IP address did not get populated from the DHCP server IP address. The reason for that was simple: CONFIG_BOOTP_SERVERIP was set. I don't know the history of that option, but it seems to decrease intuitivity levels of the dhcp command rather than improve it. What I usually would expect is that explicitly set values populate through all layers. So if I set a TFTP file name, it populates. If I set a target IP address, it populates. If I don't set anything, the values get filled in automatically. This patch set is trying to move us into that direction without breaking people that rely on the existing behavior. With this patch set applied, boards have the option to prefer the 'serverip' environment variable (ax25-ae350 gets moved to it) over the DHCP given address and any value explicitly set on the command line is always preferred. This hopefully makes the command line a bit more intuitive. v1 -> v2: - new patch: net: Prefer command line arguments - remove README entry - improve Kconfig help texts v2 -> v3: - also check for net_boot_file_name_explicit on option 67 Alexander Graf (3): net: Prefer command line arguments net: Add option to prefer bootp/dhcp serverip ax25: Switch to CONFIG_BOOTP_PREFER_SERVERIP cmd/Kconfig | 11 +++++++++++ cmd/net.c | 10 ++++++++-- configs/ax25-ae350_defconfig | 1 + include/configs/ax25-ae350.h | 1 - include/net.h | 2 ++ net/bootp.c | 21 +++++++++++++++------ net/net.c | 2 ++ 7 files changed, 39 insertions(+), 9 deletions(-)