Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.1-cherrypick] ESP32: Drop Invalid RA packets (#33060) #33102

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/platform/ESP32/route_hook/ESP32RouteHook.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ static void ra_recv_handler(struct netif * netif, const uint8_t * icmp_payload,
{
uint8_t opt_type = icmp_payload[0];
uint8_t opt_len = (uint8_t)(icmp_payload[1] << 3);
if (opt_len == 0 || opt_len > payload_len)
{
ESP_LOGE(TAG, "Invalid ND6 option length");
break;
}

if (opt_type == ND6_OPTION_TYPE_ROUTE_INFO && opt_len >= sizeof(route_option_t) - sizeof(ip6_addr_p_t) &&
!is_self_address(netif, src_addr) && payload_len >= opt_len)
Expand Down
Loading