From patchwork Fri Jun 6 06:41:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 894440 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp348556wrb; Thu, 5 Jun 2025 23:43:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVDeFqe9Ay3AqCvRa1YYGIV+nCpa38LokbwWo+SBXamnXXfP4M4P5Xi94ALyqErO+IRqx5LxQ==@linaro.org X-Google-Smtp-Source: AGHT+IGuENKyWfbmWe/BCI08t0XgL1/2iE8sbe9V9/5IHDuplxKczUSgcOleYOFrEmevlB5DqLNt X-Received: by 2002:a05:6402:2106:b0:607:b7e:4a53 with SMTP id 4fb4d7f45d1cf-60774895de7mr1586966a12.30.1749192213151; Thu, 05 Jun 2025 23:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749192213; cv=none; d=google.com; s=arc-20240605; b=TELI8m6A2qUnpig2my2JhjTeA39JjCfxswhYLhd17T66F9we3HNWLC3K/dxW1c/eXV N86ERzli61iq8k92LjCLM+S6zsYXDCn69v5k/GaDXM3OI5IovyJE3NsyOVrKHHJLCmA+ nMnGJ6jcPr4E5+AC4YbpvDp+OTWRqVRvwRUjsL77CzM5ot4zz7UmC1oZeLuOGQyAjSPv 4vFSPo1Dj1rnXilw5hhEAbJVeiI5mGfgAjcoioJO74A4SOJJNeU8FilMX648HnzOiLar 7OnCAIia8U5/d6iCN274X6lxHN9Bk594aNoEnJD0Nimq1PzgX0UxZbLWRJkJrTF6TckM bLZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CwhTKXVWqhwHFqLYHC5GbHvBwwbAmFalzwdUS9JOsXU=; fh=sAzVLzKZ1rJCL2SZ+/95rHjWka/6tp2dlfUjm3VIklg=; b=UndKToLt/aaSpCBewvUFmJTpiDZMj+OqwWByD6pWF50uMefi3j1d0r2I4nLhb9bLLx AYYngfp7kcfdZP0HWEO6tyLncXD2z3LZtUgMpcHXVONofTjo6zmHOlVxpT65o51mQ6XE MTZzRa6rPgEWQil9q+9yovuYr7ed4jX6VaeewIsa0OU1Z6vVOAXCEQpp0+nhCmrhMx7w tCLkLyTpcdIF8W/kRCSudgMjal61CSC0qRXpjdYfDuMs2RVabqKMkL7UodhJTXBWjwTs 1tAWBW1Gbpz4rGS92cFh7yMuY252wx+xj3SETuEzutllOELarzMX0hJbFspoUks2AtxV B16g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XmwbYqbj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-60778344f67si961631a12.13.2025.06.05.23.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 23:43:33 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XmwbYqbj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F9BD82B3D; Fri, 6 Jun 2025 08:42:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="XmwbYqbj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E1D8807B1; Fri, 6 Jun 2025 08:42:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 79FBB82998 for ; Fri, 6 Jun 2025 08:42:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-451d6ade159so15040945e9.1 for ; Thu, 05 Jun 2025 23:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749192150; x=1749796950; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CwhTKXVWqhwHFqLYHC5GbHvBwwbAmFalzwdUS9JOsXU=; b=XmwbYqbj6BdtPwqbI0BoWXLKXOb4Kr8SdhduScDLDgf8s32eYVWUjjy/pH0R64c7w0 ck/ZRCRVisgR6LHR1boA1ZwxGBpDsj2NsgvdK6yOcqatA8lQ7opehCHB9dGkmOK7ZI0R J5IxzfXZwGzudr0WC2A/vYTPoP65iaRw7iJVhGx/gHLUIANtDFKD+x0EmPMNhZQHqJsR NdLlb3QAud/xmgg44qTtIn3aU/FiBM0EKLpNYxo5iHiLyVPCmrW+GRf6M262f3pjX/3C gkoz5ezH9cFMoq9Pn06xKMHtQ3YxpwhfnaeRyyDXmlu5JBys9jsjo/pc9XXJ/ysPZQRW Ti7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749192150; x=1749796950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CwhTKXVWqhwHFqLYHC5GbHvBwwbAmFalzwdUS9JOsXU=; b=FR+UrV+YGuRYdsrbrDqeJ3AfIRb+w0IJQCvtEveSSTxjgPFWvrW8LducrhDCPaC71n 9BIM4aZ7aOU9fijZeo01XxHMepx0GSKwnnsxBPpxBkKIgu0iEgq3/PY0E+QJO2C6OYBG PJ/ntGLkL+QFHZzhxZBE+0vMjp6nJq2OaeE7MYupGHC4xV8Nk6spdIDzjuUxMqXZs/ZG gewKa6ylZYSmI9uUxHDnZ37e5PGP5G+GW25AUiCjJJY7RjyWxfDnty8nrxF0ILrmy/y5 JXd3vKSmfYPWKHXJNN0feRBY0HTEwCcHyfxMlAk58wH5IVHg/ciPY2lf6GgWw/yYgGO7 NJew== X-Gm-Message-State: AOJu0YxdxA2q7Z2bO+qV20EbkYj6Hfs5pybEAz7u0it0J6jzF/tHFoAG EqvglznJT4MugwM0E6HIJzAAwm0V/mAM5oU9a3BVic+l8upNsnm/rqatKgH1h791bsSP6t5snCw lhlPB X-Gm-Gg: ASbGncvV2OyxfL0QYbuQ13xf+p0EwHIkb0UO4g2xlLHxFTXkKO+GUBZseAHX5c5uvCV FPgBMk5s+sG/IoUzrcBMkT9s8Rn9ZZkhiTr/fvgfGzfZWJQUQChbSSxV9b9c+EodUW5NXiNMEGU ZWm10qGm5kdjcFYf7XXe7+OQl+4qJUwYF1Nmug52q3Gz8B2mIg3++voD2HYCSddsBGFko7AdaiH EVv7Kl5ydZbP+hACGXxmfeiyaoI3ocYOgbWCeirtCm1gOamRL3bnbYclGvO5ourYid7I2BmYLST 6TZffhQp1JTPybzw+60GhgRrS1oDOOkMu7Fc0l8SG7to+DtFcRiIssjW8qvXZbN9tdxMyic= X-Received: by 2002:a05:6000:2f88:b0:3a4:c8c1:aed8 with SMTP id ffacd0b85a97d-3a5319a6fa1mr1913618f8f.39.1749192149780; Thu, 05 Jun 2025 23:42:29 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:af71:dfb2:66ef:80c3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53244d10asm994627f8f.67.2025.06.05.23.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 23:42:29 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Tom Rini Subject: [PATCH v2 07/13] lwip: dns: do not print IP address when a variable is specified Date: Fri, 6 Jun 2025 08:41:43 +0200 Message-ID: <20250606064211.3091237-8-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250606064211.3091237-1-jerome.forissier@linaro.org> References: <20250606064211.3091237-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When calling "dns ", do not print out the IP address of onto the console. Print it only when no variable is passed. The reason is to be able to call do_dns() from another command in need of the DNS services without polluting the output. Signed-off-by: Jerome Forissier --- Changes in v2: - New patch cmd/lwip/dns.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/lwip/dns.c b/cmd/lwip/dns.c index b757638cd1e..0bfd8f198cf 100644 --- a/cmd/lwip/dns.c +++ b/cmd/lwip/dns.c @@ -42,8 +42,6 @@ static void dns_cb(const char *name, const ip_addr_t *ipaddr, void *arg) if (dns_cb_arg->var) env_set(dns_cb_arg->var, ipstr); - - printf("%s\n", ipstr); } static int dns_loop(struct udevice *udev, const char *name, const char *var) @@ -107,8 +105,11 @@ static int dns_loop(struct udevice *udev, const char *name, const char *var) net_lwip_remove_netif(netif); - if (dns_cb_arg.done && dns_cb_arg.host_ipaddr.addr != 0) + if (dns_cb_arg.done && dns_cb_arg.host_ipaddr.addr != 0) { + if (!var) + printf("%s\n", ipaddr_ntoa(&ipaddr)); return CMD_RET_SUCCESS; + } return CMD_RET_FAILURE; }