Skip to content

Commit 9af6b9e

Browse files
mniestrojjukkar
authored andcommitted
drivers: wifi: esp: set NET_CONTEXT_CONNECTED state
Set NET_CONTEXT_CONNECTED when stream socket got connected. This fixes TCP connection when using ESP WiFi driver, which got broken after sockets layer started to validate net_context connection state before allowing to receive any data. Signed-off-by: Marcin Niestroj <[email protected]>
1 parent 905f496 commit 9af6b9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/wifi/esp/esp_offload.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ static int _sock_connect(struct esp_data *dev, struct esp_socket *sock)
8181
ret = esp_cmd_send(dev, NULL, 0, connect_msg, ESP_CMD_TIMEOUT);
8282
if (ret == 0) {
8383
sock->flags |= ESP_SOCK_CONNECTED;
84+
if (sock->type == SOCK_STREAM) {
85+
net_context_set_state(sock->context,
86+
NET_CONTEXT_CONNECTED);
87+
}
8488
} else if (ret == -ETIMEDOUT) {
8589
/* FIXME:
8690
* What if the connection finishes after we return from

0 commit comments

Comments
 (0)