Merge pull request #6416 from kjbracey-arm/lwip_netconntype_fix

lwIP: fix some IPv6 errors, eg TCP keepalive
pull/6467/head
Cruz Monrreal 2018-03-26 14:27:09 -05:00 committed by GitHub
commit 57b48f6e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -1125,9 +1125,9 @@ static nsapi_error_t mbed_lwip_socket_bind(nsapi_stack_t *stack, nsapi_socket_t
if (
#if LWIP_TCP
(s->conn->type == NETCONN_TCP && s->conn->pcb.tcp->local_port != 0) ||
(NETCONNTYPE_GROUP(s->conn->type) == NETCONN_TCP && s->conn->pcb.tcp->local_port != 0) ||
#endif
(s->conn->type == NETCONN_UDP && s->conn->pcb.udp->local_port != 0)) {
(NETCONNTYPE_GROUP(s->conn->type) == NETCONN_UDP && s->conn->pcb.udp->local_port != 0)) {
return NSAPI_ERROR_PARAMETER;
}
@ -1315,7 +1315,7 @@ static nsapi_error_t mbed_lwip_setsockopt(nsapi_stack_t *stack, nsapi_socket_t h
switch (optname) {
#if LWIP_TCP
case NSAPI_KEEPALIVE:
if (optlen != sizeof(int) || s->conn->type != NETCONN_TCP) {
if (optlen != sizeof(int) || NETCONNTYPE_GROUP(s->conn->type) != NETCONN_TCP) {
return NSAPI_ERROR_UNSUPPORTED;
}
@ -1323,7 +1323,7 @@ static nsapi_error_t mbed_lwip_setsockopt(nsapi_stack_t *stack, nsapi_socket_t h
return 0;
case NSAPI_KEEPIDLE:
if (optlen != sizeof(int) || s->conn->type != NETCONN_TCP) {
if (optlen != sizeof(int) || NETCONNTYPE_GROUP(s->conn->type) != NETCONN_TCP) {
return NSAPI_ERROR_UNSUPPORTED;
}
@ -1331,7 +1331,7 @@ static nsapi_error_t mbed_lwip_setsockopt(nsapi_stack_t *stack, nsapi_socket_t h
return 0;
case NSAPI_KEEPINTVL:
if (optlen != sizeof(int) || s->conn->type != NETCONN_TCP) {
if (optlen != sizeof(int) || NETCONNTYPE_GROUP(s->conn->type) != NETCONN_TCP) {
return NSAPI_ERROR_UNSUPPORTED;
}