From patchwork Thu Jun 14 10:04:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138534 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1904892lji; Thu, 14 Jun 2018 03:05:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKhOLyir3RAWSq+WIYrvUC5LgLAO3kk2RdTe75CGYxO/7dIsV7cB9epvjmO1+GEiqTq1r7m X-Received: by 2002:a50:8522:: with SMTP id 31-v6mr2070437edr.299.1528970742911; Thu, 14 Jun 2018 03:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528970742; cv=none; d=google.com; s=arc-20160816; b=EuuQ+270rN7E8oof38Xi2hITqBblGC4TU9qu3TuWtUZl4DJSZ1nHU1IIj3nhfppNIO bCVUPGxC+GjWc1WhnsMCXyBvXmmMdvbKatsJMk8wbeNFCkoccQFK8KSU4710p8bGr4/2 fEGl/I/62nA7LBcGGjOAtk9FcCqfEOlM5kRJ0MNh3zM9JMpJ9RTTxtbOjmQP2qMfGNVy qeCqoFvF2uIj8rSpItlA/H9wxjH0yh0ct52VaRA7jdnNIs/Sh0TAedC/sr5qeBpBD0An XvqRKZUZB9ss6AqgOBWuYLlpAm72wZdhbs7XCoBQ1HS27QJkER8vSu9QZV/i/2N7RKQa k4QQ== 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=qcNznnwEAM5GqAmRLfUY6o4GUJd2QBW5MGa7eWEsGIU=; b=iqBJnSXOB27i4CuiOhMDoHg3+STbkPutyV/2PMF0xqcAtKNw92kwq9G1zrTroCQEq3 FSryfO9J7+3BH3H+CjO5yoqcHf5x9XToggKivBaNyVOO5BP2xJqIe7dVIFkW3DH6TVas nG7nSKwGbC9Azmi7WDN8nryRbjPn+P/rP0yy786UR+D7EJPMANueoqjRKBSYfFqkF34O tYPsyGxvqqL0PqNp5UI9DQF0ZmZCEpRFaEyiKgqaQHMeCtO6oiktsLfRiHU9bjy1y5t9 F+ednjnL0poLPFvLCLl/7gZPz+AT6bvCCDqvYi/hih5eKbVCnQkbR5iT7Gv0xlkpQH6P mn4g== 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 94-v6si3543777edk.274.2018.06.14.03.05.42; Thu, 14 Jun 2018 03:05:42 -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 7A046C21DA1; Thu, 14 Jun 2018 10:04: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 EFB49C21DB6; Thu, 14 Jun 2018 10:04:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 663A4C21CB6; Thu, 14 Jun 2018 10:04:29 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 02B9FC21CB6 for ; Thu, 14 Jun 2018 10:04:29 +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 60494AE26; Thu, 14 Jun 2018 10:04:28 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 12:04:23 +0200 Message-Id: <20180614100426.40511-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 Cc: Joe Hershberger , greentime@andestech.com Subject: [U-Boot] [PATCH v2 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 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 | 10 ++++++++-- net/net.c | 2 ++ 7 files changed, 32 insertions(+), 5 deletions(-)