Skip to content

Commit 919756c

Browse files
committed
extmod/modlwip: Fix IGMP address type when IPv6 is enabled.
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]>
1 parent 85053ad commit 919756c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extmod/modlwip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ static mp_obj_t lwip_socket_setsockopt(size_t n_args, const mp_obj_t *args) {
14321432
case IP_DROP_MEMBERSHIP: {
14331433
mp_buffer_info_t bufinfo;
14341434
mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ);
1435-
if (bufinfo.len != sizeof(ip_addr_t) * 2) {
1435+
if (bufinfo.len != sizeof(MP_IGMP_IP_ADDR_TYPE) * 2) {
14361436
mp_raise_ValueError(NULL);
14371437
}
14381438

0 commit comments

Comments
 (0)