get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2122109/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2122109,
    "url": "http://patchwork.ozlabs.org/api/patches/2122109/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20250812124331.1464879-3-jerome.forissier@linaro.org/",
    "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": "<20250812124331.1464879-3-jerome.forissier@linaro.org>",
    "list_archive_url": null,
    "date": "2025-08-12T12:43:19",
    "name": "[v2,2/2] net: lwip: add Kconfig option to show ICMP unreachable errors",
    "commit_ref": "6b914d5596d947ebea4e8697004e210df1abe61e",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "813e440416409dc94730657a92b1cfa3f89713a8",
    "submitter": {
        "id": 69192,
        "url": "http://patchwork.ozlabs.org/api/people/69192/?format=api",
        "name": "Jerome Forissier",
        "email": "jerome.forissier@linaro.org"
    },
    "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/20250812124331.1464879-3-jerome.forissier@linaro.org/mbox/",
    "series": [
        {
            "id": 468862,
            "url": "http://patchwork.ozlabs.org/api/series/468862/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=468862",
            "date": "2025-08-12T12:43:17",
            "name": "lwip: add Kconfig to decode and print ICMP unreachable messages",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/468862/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2122109/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2122109/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\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=bef5fq1U;\n\tdkim-atps=neutral",
            "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=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"bef5fq1U\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=jerome.forissier@linaro.org"
        ],
        "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 4c1WS00gN7z1xwC\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 12 Aug 2025 22:45:04 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 483ED8354B;\n\tTue, 12 Aug 2025 14:43:59 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id AB42183542; Tue, 12 Aug 2025 14:43:58 +0200 (CEST)",
            "from mail-wm1-x330.google.com (mail-wm1-x330.google.com\n [IPv6:2a00:1450:4864:20::330])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 6CBA1832DA\n for <u-boot@lists.denx.de>; Tue, 12 Aug 2025 14:43:56 +0200 (CEST)",
            "by mail-wm1-x330.google.com with SMTP id\n 5b1f17b1804b1-455b00339c8so35007915e9.3\n for <u-boot@lists.denx.de>; Tue, 12 Aug 2025 05:43:56 -0700 (PDT)",
            "from builder.. ([2a01:e0a:3cb:7bb0:6b34:4d0b:774a:130d])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-459e585430csm297745475e9.11.2025.08.12.05.43.54\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 12 Aug 2025 05:43:54 -0700 (PDT)"
        ],
        "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,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1755002636; x=1755607436; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=z+paRYOEvn+mBKTImcPblDWeAHOnqrcNV2MJ4Wz+O1o=;\n b=bef5fq1U5kU4C9VbzIsHMqEortHGfvZccvuVMYb4Y7rKjHT3nkgoE8UuveMtguADFE\n pH5M2/5ukDykiNMWfQGUaoSGzlMgSeuzeTb++L3e0T8EHmJLkw6hwwY+UIXkR41SCGiZ\n Tv3oYNOlh5XJ00rZJTty7xN4dY5dxbYKIMy9q2/Ygsl/ICADZsZETwZ4qZ7b5gRaDbzS\n QdfWx4XYRIVf013nutc2TZWrzgZ/iWTzXwlbPFk6Jl7d/PUNtFkm2PvCOjH2S+aLeLrH\n LFkvwrg02GmSTMTmfzHulnqRKWlDNsKv09FwnK3H8Co4ylRx7xPY5wRYxpGsZ3clh0h5\n /keQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1755002636; x=1755607436;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=z+paRYOEvn+mBKTImcPblDWeAHOnqrcNV2MJ4Wz+O1o=;\n b=GqkhuL2vVhBj6KYJMHStD1DEJNZz7se/d12Ksi5I07F4tP1f9wQdvW8o+MFkyJCiez\n FcVA2dSKtyswqqQx3xnyK++XLf7cVTcC0JPJYfcStPpBfBgrcXJjmKGvxdnTUZLbxE8K\n wbXIwX7Ez8dIi3VtSf1C17juqhF3xCtlbE53Rws4sl2qsU87XBLQjuOzvLwVHIhpF/hr\n 16F0NHiCcbQkIHUGeNN3K1sq339wfO148e5qiKJe5GFTBKzVBjxGTwV/tM8NecxK5EEC\n a1l8fv/o5IGbKJDmMTwxQS08PrcS3kwZ+wHiW/cnMr+BKspqo32pBKEKzo8/dfRosxdm\n 5btA==",
        "X-Gm-Message-State": "AOJu0YzSFOWUx6KdjeaOmvI7zGBr6qWhmseHCNbeswtiLhY1DutLf54I\n +5gghJQL9nXfczxd4yd16EpRGezBWQ8afP7J3BLCICdY9//Q3cpAZllkvFiiQ7rosYH5RU9KiaZ\n 6kdwsGbT8Dg==",
        "X-Gm-Gg": "ASbGncuzBSKIMFUhe0osANizHxSNnrndI5RG96ATliZNsl3gjRkjSnWagFejm0Jxx0v\n xzQGmsEEbhPrJG3W1FDSZTFEmyFlkx9W8Jrh8Me71VzbDUJR7olkekeDmkatiPDGGc2mu3buLhI\n 1aBzNRisn+O1YZFj9MD50FNipFYDQ6NiCj4X7w6ef7YM9d2Jb7joDX4mmsVS1dwUUEbExYS2osR\n V9duovWGniABmmU6qLHyHWj3L3MHpC0RdJwGpCLvsmXb+HsSUveF5ONFXwQLsHVECzcQdRs/NtH\n vczrIw5glEXJoin1y/AjdskBJhc1QSyKO32N8AxwYhUrn5E2mVUmKoRzppy9B5q72T10LbsldO/\n sbSyfQy1SOPEytGyts2zL8We4sCpO4ZTIxrG3EbvB+g==",
        "X-Google-Smtp-Source": "\n AGHT+IEyoSWRLYESsuw5xx4UDIt3gqDAzJuknVEh9TkjSWm7ip5Pn7cb8TBLFKLXvCbahawljlnB/w==",
        "X-Received": "by 2002:a05:600c:1ca3:b0:459:443e:b180 with SMTP id\n 5b1f17b1804b1-45a10ba7b18mr31422675e9.8.1755002635630;\n Tue, 12 Aug 2025 05:43:55 -0700 (PDT)",
        "From": "Jerome Forissier <jerome.forissier@linaro.org>",
        "To": "U-Boot mailing list <u-boot@lists.denx.de>",
        "Cc": "Jerome Forissier <jerome.forissier@linaro.org>,\n Adriano Cordova <adrianox@gmail.com>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Javier Tia <javier.tia@linaro.org>,\n Joe Hershberger <joe.hershberger@ni.com>,\n Ramon Fried <rfried.dev@gmail.com>, Simon Glass <sjg@chromium.org>,\n Tim Harvey <tharvey@gateworks.com>, Tom Rini <trini@konsulko.com>",
        "Subject": "[PATCH v2 2/2] net: lwip: add Kconfig option to show ICMP unreachable\n errors",
        "Date": "Tue, 12 Aug 2025 14:43:19 +0200",
        "Message-ID": "<20250812124331.1464879-3-jerome.forissier@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20250812124331.1464879-1-jerome.forissier@linaro.org>",
        "References": "<20250812124331.1464879-1-jerome.forissier@linaro.org>",
        "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": "Add Kconfig symbol LWIP_ICMP_SHOW_UNREACH which, when enabled, prints a\nmessage to the console upon reception of ICMP unreachable messages. For\nexample:\n\n $ make qemu_arm64_lwip_defconfig\n $ qemu-system-aarch64 -M virt -cpu max -nographic -bios u-boot.bin\n [...]\n => dhcp\n DHCP client bound to address 10.0.2.15 (0 ms)\n => tftp 192.168.0.100:69:Image\n Using virtio-net#32 device\n TFTP from server 192.168.0.100; our IP address is 10.0.2.15\n Filename 'Image'.\n Load address: 0x40200000\n Loading: ICMP destination unreachable (host unreachable) from 192.168.0.16\n Timeout!\n => tftp 192.168.0.16:69:Image\n Using virtio-net#32 device\n TFTP from server 192.168.0.16; our IP address is 10.0.2.15\n Filename 'Image'.\n Load address: 0x40200000\n Loading: ICMP destination unreachable (port unreachable) from 192.168.0.16\n Timeout!\n =>\n\nSubmitted upstream as https://github.com/lwip-tcpip/lwip/pull/73.\n\nSigned-off-by: Jerome Forissier <jerome.forissier@linaro.org>\n---\n\nChanges in v2:\n- Add link to upstream pull request\n\n lib/lwip/u-boot/arch/cc.h  |  7 +++++++\n lib/lwip/u-boot/lwipopts.h |  4 ++++\n net/lwip/Kconfig           | 13 +++++++++++++\n net/lwip/Makefile          |  1 +\n net/lwip/icmp_unreach.c    | 38 ++++++++++++++++++++++++++++++++++++++\n 5 files changed, 63 insertions(+)\n create mode 100644 net/lwip/icmp_unreach.c",
    "diff": "diff --git a/lib/lwip/u-boot/arch/cc.h b/lib/lwip/u-boot/arch/cc.h\nindex 04ab94d6b70..849c79c5a8d 100644\n--- a/lib/lwip/u-boot/arch/cc.h\n+++ b/lib/lwip/u-boot/arch/cc.h\n@@ -56,4 +56,11 @@ static inline const char *sntp_format_time(time_t t)\n }\n \n #define sntp_format_time sntp_format_time\n+\n+#ifdef CONFIG_LWIP_ICMP_SHOW_UNREACH\n+struct pbuf;\n+void net_lwip_icmp_dest_unreach(int code, struct pbuf *p);\n+\n+#define ICMP_DEST_UNREACH_CB(_c, _p) net_lwip_icmp_dest_unreach(_c, _p)\n+#endif\n #endif /* LWIP_ARCH_CC_H */\ndiff --git a/lib/lwip/u-boot/lwipopts.h b/lib/lwip/u-boot/lwipopts.h\nindex 46af91f9410..80b93ea172d 100644\n--- a/lib/lwip/u-boot/lwipopts.h\n+++ b/lib/lwip/u-boot/lwipopts.h\n@@ -80,7 +80,11 @@\n \n #define IP_DEFAULT_TTL                  255\n \n+#if defined(CONFIG_PROT_ICMP_LWIP)\n+#define LWIP_ICMP                       1\n+#else\n #define LWIP_ICMP                       0\n+#endif\n \n #if defined(CONFIG_PROT_RAW_LWIP)\n #define LWIP_RAW                        1\ndiff --git a/net/lwip/Kconfig b/net/lwip/Kconfig\nindex d28a8a7df94..5789766fe62 100644\n--- a/net/lwip/Kconfig\n+++ b/net/lwip/Kconfig\n@@ -4,6 +4,16 @@\n \n if NET_LWIP\n \n+config LWIP_ICMP_SHOW_UNREACH\n+\tbool \"Print ICMP Destination Unreachable messages\"\n+\tdefault y\n+\tdepends on CMD_TFTPBOOT || CMD_SNTP\n+\tselect PROT_ICMP_LWIP\n+\thelp\n+\t  Prints a message whenever an ICMP Destination Unreachable message is\n+\t  received while running a network command that sends requests via UDP.\n+\t  Enabling this can make troubleshooting easier.\n+\n config LWIP_DEBUG\n \tbool \"Enable debug traces in the lwIP library\"\n \thelp\n@@ -31,6 +41,9 @@ config PROT_DNS_LWIP\n \tbool\n \tselect PROT_UDP_LWIP\n \n+config PROT_ICMP_LWIP\n+\tbool\n+\n config PROT_RAW_LWIP\n \tbool\n \ndiff --git a/net/lwip/Makefile b/net/lwip/Makefile\nindex 97299d9b542..09c3b3511a4 100644\n--- a/net/lwip/Makefile\n+++ b/net/lwip/Makefile\n@@ -2,6 +2,7 @@ ccflags-y += -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot\n \n obj-$(CONFIG_$(PHASE_)DM_ETH) += net-lwip.o\n obj-$(CONFIG_CMD_DHCP) += dhcp.o\n+obj-$(CONFIG_LWIP_ICMP_SHOW_UNREACH) += icmp_unreach.o\n obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o\n obj-$(CONFIG_WGET) += wget.o\n \ndiff --git a/net/lwip/icmp_unreach.c b/net/lwip/icmp_unreach.c\nnew file mode 100644\nindex 00000000000..9e8a05f5717\n--- /dev/null\n+++ b/net/lwip/icmp_unreach.c\n@@ -0,0 +1,38 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/* Copyright (C) 2025 Linaro Ltd. */\n+\n+#include <lwip/icmp.h>\n+#include <lwip/ip4_addr.h>\n+#include <lwip/pbuf.h>\n+#include <lwip/prot/ip4.h>\n+\n+static const char *code_to_str(int code)\n+{\n+\tswitch (code) {\n+\tcase ICMP_DUR_NET:\n+\t\treturn \"network unreachable\";\n+\tcase ICMP_DUR_HOST:\n+\t\treturn \"host unreachable\";\n+\tcase ICMP_DUR_PROTO:\n+\t\treturn \"protocol unreachable\";\n+\tcase ICMP_DUR_PORT:\n+\t\treturn \"port unreachable\";\n+\tcase ICMP_DUR_FRAG:\n+\t\treturn \"fragmentation needed and DF set\";\n+\tcase ICMP_DUR_SR:\n+\t\treturn \"source route failed\";\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\treturn \"unknown cause\";\n+}\n+\n+void net_lwip_icmp_dest_unreach(int code, struct pbuf *p)\n+{\n+\tstruct ip_hdr *iphdr = (struct ip_hdr *)p->payload;\n+\tip4_addr_t src;\n+\n+\tip4_addr_copy(src, iphdr->src);\n+\tprintf(\"ICMP destination unreachable (%s) from %s\\n\",\n+\t       code_to_str(code), ip4addr_ntoa(&src));\n+}\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}