Skip to content

Commit

Permalink
extmod/modlwip: Fix IGMP address type when IPv6 is enabled.
Browse files Browse the repository at this point in the history
This was missed in 628abf8.  The the bug
was that, when IPv6 is enabled, the `sizeof(ip_addr_t)` is much larger than
IPv4 size, which is what's needed for IGMP addressing.

Fixes issue micropython#16100.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Nov 18, 2024
1 parent a7d3bc2 commit 6f32768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extmod/modlwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ static mp_obj_t lwip_socket_setsockopt(size_t n_args, const mp_obj_t *args) {
case IP_DROP_MEMBERSHIP: {
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ);
if (bufinfo.len != sizeof(ip_addr_t) * 2) {
if (bufinfo.len != sizeof(MP_IGMP_IP_ADDR_TYPE) * 2) {
mp_raise_ValueError(NULL);
}

Expand Down

0 comments on commit 6f32768

Please sign in to comment.