Skip to content

Commit

Permalink
Fix #793, Remove unreachable code in OS_SocketOpen_Impl for BSD socket
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Feb 11, 2021
1 parent 09a2c5e commit 15ab294
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/os/portable/os-impl-bsd-sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,14 @@ int32 OS_SocketOpen_Impl(const OS_object_token_t *token)
return OS_ERR_NOT_IMPLEMENTED;
}

switch (stream->socket_domain)
/* Only AF_INET* at this point, can add cases if support is expanded */
switch (stream->socket_type)
{
case OS_SocketDomain_INET:
case OS_SocketDomain_INET6:
switch (stream->socket_type)
{
case OS_SocketType_DATAGRAM:
os_proto = IPPROTO_UDP;
break;
case OS_SocketType_STREAM:
os_proto = IPPROTO_TCP;
break;
default:
break;
}
case OS_SocketType_DATAGRAM:
os_proto = IPPROTO_UDP;
break;
default:
case OS_SocketType_STREAM:
os_proto = IPPROTO_TCP;
break;
}

Expand Down

0 comments on commit 15ab294

Please sign in to comment.