Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2092514/?format=api
{ "id": 2092514, "url": "http://patchwork.ozlabs.org/api/patches/2092514/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20250530153826.1057407-4-tharvey@gateworks.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20250530153826.1057407-4-tharvey@gateworks.com>", "list_archive_url": null, "date": "2025-05-30T15:38:25", "name": "[v2,4/5] net: lwip: move dns init to common function", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cdf197d972d8259eee4bcd63403eb35b7d790767", "submitter": { "id": 41730, "url": "http://patchwork.ozlabs.org/api/people/41730/?format=api", "name": "Tim Harvey", "email": "tharvey@gateworks.com" }, "delegate": { "id": 157425, "url": "http://patchwork.ozlabs.org/api/users/157425/?format=api", "username": "jforissier", "first_name": "Jerome", "last_name": "Forissier", "email": "jerome.forissier@linaro.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20250530153826.1057407-4-tharvey@gateworks.com/mbox/", "series": [ { "id": 459049, "url": "http://patchwork.ozlabs.org/api/series/459049/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=459049", "date": "2025-05-30T15:38:23", "name": "[v2,1/5] net: lwip: call sys_check_timeouts and schedule on rx", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/459049/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2092514/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2092514/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=gateworks.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=gateworks.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=tharvey@gateworks.com" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4b86pm2rx3z1yFb\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 31 May 2025 01:38:56 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id C60B18334A;\n\tFri, 30 May 2025 17:38:40 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 79FCE8331C; Fri, 30 May 2025 17:38:35 +0200 (CEST)", "from finn.localdomain (finn.gateworks.com [108.161.129.64])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id CF89883327\n for <u-boot@lists.denx.de>; Fri, 30 May 2025 17:38:32 +0200 (CEST)", "from syn-068-189-091-139.biz.spectrum.com ([68.189.91.139]\n helo=tharvey.pdc.gateworks.com)\n by finn.localdomain with esmtp (Exim 4.95)\n (envelope-from <tharvey@gateworks.com>) id 1uL1oU-007QGb-Qa;\n Fri, 30 May 2025 15:38:30 +0000" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-1.9 required=5.0 tests=BAYES_00,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "From": "Tim Harvey <tharvey@gateworks.com>", "To": "u-boot@lists.denx.de", "Cc": "Jerome Forissier <jerome.forissier@linaro.org>,\n Heinrich Schuchardt <heinrich.schuchardt@canonical.com>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Joe Hershberger <joe.hershberger@ni.com>,\n Ramon Fried <rfried.dev@gmail.com>, Simon Glass <sjg@chromium.org>,\n Tom Rini <trini@konsulko.com>, Tim Harvey <tharvey@gateworks.com>", "Subject": "[PATCH v2 4/5] net: lwip: move dns init to common function", "Date": "Fri, 30 May 2025 08:38:25 -0700", "Message-Id": "<20250530153826.1057407-4-tharvey@gateworks.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20250530153826.1057407-1-tharvey@gateworks.com>", "References": "<20250530153826.1057407-1-tharvey@gateworks.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "move the dns init including setting the dns servers from env vars to a\ncommon function as other commands that support hostname lookups will\nneed this.\n\nSigned-off-by: Tim Harvey <tharvey@gateworks.com>\nReviewed-by: Jerome Forissier <jerome.forissier@linaro.org>\n---\nv2:\n - added tags\n---\n include/net-lwip.h | 1 +\n net/lwip/dns.c | 20 +-------------------\n net/lwip/net-lwip.c | 30 ++++++++++++++++++++++++++++++\n 3 files changed, 32 insertions(+), 19 deletions(-)", "diff": "diff --git a/include/net-lwip.h b/include/net-lwip.h\nindex b762956e8fda..6b5eb1990fbf 100644\n--- a/include/net-lwip.h\n+++ b/include/net-lwip.h\n@@ -17,6 +17,7 @@ static inline int eth_is_on_demand_init(void)\n \n int eth_init_state_only(void); /* Set active state */\n \n+int net_lwip_dns_init(void);\n int net_lwip_eth_start(void);\n struct netif *net_lwip_new_netif(struct udevice *udev);\n struct netif *net_lwip_new_netif_noip(struct udevice *udev);\ndiff --git a/net/lwip/dns.c b/net/lwip/dns.c\nindex 738f8bf3196b..744040f26d29 100644\n--- a/net/lwip/dns.c\n+++ b/net/lwip/dns.c\n@@ -44,12 +44,9 @@ static void dns_cb(const char *name, const ip_addr_t *ipaddr, void *arg)\n static int dns_loop(struct udevice *udev, const char *name, const char *var)\n {\n \tstruct dns_cb_arg dns_cb_arg = { };\n-\tbool has_server = false;\n \tstruct netif *netif;\n \tip_addr_t ipaddr;\n-\tip_addr_t ns;\n \tulong start;\n-\tchar *nsenv;\n \tint ret;\n \n \tdns_cb_arg.var = var;\n@@ -58,22 +55,7 @@ static int dns_loop(struct udevice *udev, const char *name, const char *var)\n \tif (!netif)\n \t\treturn CMD_RET_FAILURE;\n \n-\tdns_init();\n-\n-\tnsenv = env_get(\"dnsip\");\n-\tif (nsenv && ipaddr_aton(nsenv, &ns)) {\n-\t\tdns_setserver(0, &ns);\n-\t\thas_server = true;\n-\t}\n-\n-\tnsenv = env_get(\"dnsip2\");\n-\tif (nsenv && ipaddr_aton(nsenv, &ns)) {\n-\t\tdns_setserver(1, &ns);\n-\t\thas_server = true;\n-\t}\n-\n-\tif (!has_server) {\n-\t\tlog_err(\"No valid name server (dnsip/dnsip2)\\n\");\n+\tif (net_lwip_dns_init()) {\n \t\tnet_lwip_remove_netif(netif);\n \t\treturn CMD_RET_FAILURE;\n \t}\ndiff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c\nindex e8d4cc542ed8..23dccfef8993 100644\n--- a/net/lwip/net-lwip.c\n+++ b/net/lwip/net-lwip.c\n@@ -7,6 +7,7 @@\n #include <dm/uclass.h>\n #include <hexdump.h>\n #include <lwip/ip4_addr.h>\n+#include <lwip/dns.h>\n #include <lwip/err.h>\n #include <lwip/netif.h>\n #include <lwip/pbuf.h>\n@@ -139,6 +140,35 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,\n \treturn 0;\n }\n \n+/*\n+ * Initialize DNS via env\n+ */\n+int net_lwip_dns_init(void)\n+{\n+\tbool has_server = false;\n+\tip_addr_t ns;\n+\tchar *nsenv;\n+\n+\tnsenv = env_get(\"dnsip\");\n+\tif (nsenv && ipaddr_aton(nsenv, &ns)) {\n+\t\tdns_setserver(0, &ns);\n+\t\thas_server = true;\n+\t}\n+\n+\tnsenv = env_get(\"dnsip2\");\n+\tif (nsenv && ipaddr_aton(nsenv, &ns)) {\n+\t\tdns_setserver(1, &ns);\n+\t\thas_server = true;\n+\t}\n+\n+\tif (!has_server) {\n+\t\tlog_err(\"No valid name server (dnsip/dnsip2)\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /*\n * Initialize the network stack if needed and start the current device if valid\n */\n", "prefixes": [ "v2", "4/5" ] }