Skip to content

Pico W: Enable, use SOF_REUSEADDR #7119

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

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions ports/raspberrypi/common-hal/socketpool/Socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,8 @@ bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t *socket,
mp_raise_OSError(EHOSTUNREACH);
}

ip_set_option(socket->pcb.ip, SOF_REUSEADDR);

err_t err = ERR_ARG;
switch (socket->type) {
case MOD_NETWORK_SOCK_STREAM: {
Expand Down
1 change: 1 addition & 0 deletions ports/raspberrypi/common-hal/socketpool/Socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ typedef struct _lwip_socket_obj_t {
mp_obj_base_t base;

volatile union {
struct tcp_pcb *ip;
struct tcp_pcb *tcp;
struct udp_pcb *udp;
struct raw_pcb *raw;
Expand Down
1 change: 1 addition & 0 deletions ports/raspberrypi/lwip_inc/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define LWIP_NETIF_TX_SINGLE_PBUF 1
#define DHCP_DOES_ARP_CHECK 0
#define LWIP_DHCP_DOES_ACD_CHECK 0
#define SO_REUSE 1

#ifndef NDEBUG
#define LWIP_DEBUG 1
Expand Down