-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lwip: Add patch to fix RA LLADDR processing (#29600)
* lwip: Add patch to fix RA LLADDR processing * Fix weird spacing issue in patch. * Restyled by prettier-markdown * Add lladdr to wordlist --------- Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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; | ||
} |