From 33643969d071cf8133fd0c3582158216c00c5f0f Mon Sep 17 00:00:00 2001 From: C Freeman Date: Mon, 16 Oct 2023 16:51:41 -0400 Subject: [PATCH] lwIP: reference upstream patches for ND6 LLADDR (#29789) * lwIP: reference upstream patches for ND6 LLADDR * fix link * add to wordlist --- .github/.wordlist.txt | 1 + src/lwip/patches/README.md | 10 ++++++---- src/lwip/patches/nd6_lladdr_fix.patch | 24 ------------------------ 3 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 src/lwip/patches/nd6_lladdr_fix.patch diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index f16d617c7c6e1c..cb8e31e28b2d23 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -477,6 +477,7 @@ edaf edc EDR ee +eea EEE eef ef diff --git a/src/lwip/patches/README.md b/src/lwip/patches/README.md index cb56e7a22e5d0d..130724df048a9e 100644 --- a/src/lwip/patches/README.md +++ b/src/lwip/patches/README.md @@ -21,11 +21,13 @@ recent API change on upstream LwIP. The previous version of this function is ### ND6 LLADDR fix -This patch fixes a bug where the RA processing fails if the RA includes an -LLADDR option with a hw address that is not the max length. This happens for -thread devices. +In earlier version of lwIP, there is a bug where the RA processing fails if the +RA includes an LLADDR option with a hw address that is not the max length. This +happens for thread devices. Relevant patches from lwIP main that should be +applied back to any Matter device using an older version of lwIP: -- patch file: nd6_lladdr_fix.patch +https://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=7807f706f357d2eea85d9927d970991dc4b1ef90 +https://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=6f700a157d1049a06ab9c467057d71e98e7798de ## Important upstream patches diff --git a/src/lwip/patches/nd6_lladdr_fix.patch b/src/lwip/patches/nd6_lladdr_fix.patch deleted file mode 100644 index 8ce931e01d1712..00000000000000 --- a/src/lwip/patches/nd6_lladdr_fix.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c -index 55b5774f..8559d69b 100644 ---- a/src/core/ipv6/nd6.c -+++ b/src/core/ipv6/nd6.c -@@ -686,14 +686,15 @@ nd6_input(struct pbuf *p, struct netif *inp) - switch (option_type) { - case ND6_OPTION_TYPE_SOURCE_LLADDR: - { -- struct lladdr_option *lladdr_opt; -- if (option_len < (ND6_LLADDR_OPTION_MIN_LENGTH + inp->hwaddr_len)) { -+ const u8_t option_type_and_length_size = 1 + 1; -+ const u8_t *addr_cursor; -+ if (option_len < (option_type_and_length_size + inp->hwaddr_len)) { - goto lenerr_drop_free_return; - } -- lladdr_opt = (struct lladdr_option *)buffer; -+ addr_cursor = buffer + option_type_and_length_size; - if ((default_router_list[i].neighbor_entry != NULL) && - (default_router_list[i].neighbor_entry->state == ND6_INCOMPLETE)) { -- SMEMCPY(default_router_list[i].neighbor_entry->lladdr, lladdr_opt->addr, inp->hwaddr_len); -+ SMEMCPY(default_router_list[i].neighbor_entry->lladdr, addr_cursor, inp->hwaddr_len); - default_router_list[i].neighbor_entry->state = ND6_REACHABLE; - default_router_list[i].neighbor_entry->counter.reachable_time = reachable_time; - }