|
@ -386,7 +386,8 @@ STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { |
|
|
|
|
|
|
|
|
switch (opt) { |
|
|
switch (opt) { |
|
|
// level: SOL_SOCKET
|
|
|
// level: SOL_SOCKET
|
|
|
case SO_REUSEADDR: { |
|
|
case SO_REUSEADDR: |
|
|
|
|
|
case SO_BROADCAST: { |
|
|
int val = mp_obj_get_int(args[3]); |
|
|
int val = mp_obj_get_int(args[3]); |
|
|
int ret = lwip_setsockopt(self->fd, SOL_SOCKET, opt, &val, sizeof(int)); |
|
|
int ret = lwip_setsockopt(self->fd, SOL_SOCKET, opt, &val, sizeof(int)); |
|
|
if (ret != 0) { |
|
|
if (ret != 0) { |
|
@ -858,6 +859,7 @@ STATIC const mp_rom_map_elem_t mp_module_socket_globals_table[] = { |
|
|
{ MP_ROM_QSTR(MP_QSTR_IPPROTO_IP), MP_ROM_INT(IPPROTO_IP) }, |
|
|
{ MP_ROM_QSTR(MP_QSTR_IPPROTO_IP), MP_ROM_INT(IPPROTO_IP) }, |
|
|
{ MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_ROM_INT(SOL_SOCKET) }, |
|
|
{ MP_ROM_QSTR(MP_QSTR_SOL_SOCKET), MP_ROM_INT(SOL_SOCKET) }, |
|
|
{ MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_ROM_INT(SO_REUSEADDR) }, |
|
|
{ MP_ROM_QSTR(MP_QSTR_SO_REUSEADDR), MP_ROM_INT(SO_REUSEADDR) }, |
|
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_SO_BROADCAST), MP_ROM_INT(SO_BROADCAST) }, |
|
|
{ MP_ROM_QSTR(MP_QSTR_IP_ADD_MEMBERSHIP), MP_ROM_INT(IP_ADD_MEMBERSHIP) }, |
|
|
{ MP_ROM_QSTR(MP_QSTR_IP_ADD_MEMBERSHIP), MP_ROM_INT(IP_ADD_MEMBERSHIP) }, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|