Skip to content

Commit 0b7a9a9

Browse files
authored
Merge pull request #6333 from mikaleppanen/lwip_tcp_flag_corr
Corrected lwip adaptation TCP flagging
2 parents 7ab4b06 + af29734 commit 0b7a9a9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

features/FEATURE_LWIP/lwip-interface/lwip_stack.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,7 @@ static nsapi_error_t mbed_lwip_socket_bind(nsapi_stack_t *stack, nsapi_socket_t
11451145

11461146
static nsapi_error_t mbed_lwip_socket_listen(nsapi_stack_t *stack, nsapi_socket_t handle, int backlog)
11471147
{
1148+
#if LWIP_TCP
11481149
struct lwip_socket *s = (struct lwip_socket *)handle;
11491150

11501151
if (s->conn->pcb.tcp->local_port == 0) {
@@ -1153,6 +1154,9 @@ static nsapi_error_t mbed_lwip_socket_listen(nsapi_stack_t *stack, nsapi_socket_
11531154

11541155
err_t err = netconn_listen_with_backlog(s->conn, backlog);
11551156
return mbed_lwip_err_remap(err);
1157+
#else
1158+
return NSAPI_ERROR_UNSUPPORTED;
1159+
#endif
11561160
}
11571161

11581162
static nsapi_error_t mbed_lwip_socket_connect(nsapi_stack_t *stack, nsapi_socket_t handle, nsapi_addr_t addr, uint16_t port)
@@ -1173,6 +1177,7 @@ static nsapi_error_t mbed_lwip_socket_connect(nsapi_stack_t *stack, nsapi_socket
11731177

11741178
static nsapi_error_t mbed_lwip_socket_accept(nsapi_stack_t *stack, nsapi_socket_t server, nsapi_socket_t *handle, nsapi_addr_t *addr, uint16_t *port)
11751179
{
1180+
#if LWIP_TCP
11761181
struct lwip_socket *s = (struct lwip_socket *)server;
11771182
struct lwip_socket *ns = mbed_lwip_arena_alloc();
11781183
if (!ns) {
@@ -1199,6 +1204,9 @@ static nsapi_error_t mbed_lwip_socket_accept(nsapi_stack_t *stack, nsapi_socket_
11991204
netconn_set_nonblocking(ns->conn, true);
12001205

12011206
return 0;
1207+
#else
1208+
return NSAPI_ERROR_UNSUPPORTED;
1209+
#endif
12021210
}
12031211

12041212
static nsapi_size_or_error_t mbed_lwip_socket_send(nsapi_stack_t *stack, nsapi_socket_t handle, const void *data, nsapi_size_t size)

0 commit comments

Comments
 (0)