Skip to content

lwip - Fixed error code on disconnect TCP socket #2722

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
Sep 18, 2016
Merged
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
5 changes: 3 additions & 2 deletions features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,12 @@ void lwip_bringdown(void)
static int lwip_err_remap(err_t err) {
switch (err) {
case ERR_OK:
case ERR_CLSD:
case ERR_RST:
return 0;
case ERR_MEM:
return NSAPI_ERROR_NO_MEMORY;
case ERR_CONN:
case ERR_CLSD:
return NSAPI_ERROR_NO_CONNECTION;
case ERR_TIMEOUT:
case ERR_RTE:
Expand Down Expand Up @@ -353,7 +354,7 @@ static int lwip_socket_recv(nsapi_stack_t *stack, nsapi_socket_t handle, void *d
s->offset = 0;

if (err != ERR_OK) {
return (err == ERR_CLSD) ? 0 : lwip_err_remap(err);
return lwip_err_remap(err);
}
}

Expand Down