Skip to content

Commit

Permalink
net/inet: net/inet: Fix bug that failed to open socket
Browse files Browse the repository at this point in the history
  • Loading branch information
SPRESENSE authored Mar 7, 2023
2 parents 7c1f3dd + 2e2d92a commit ce8b377
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/inet/inet_sockif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,14 +1907,16 @@ FAR const struct sock_intf_s *
else
#endif
#ifdef NET_UDP_HAVE_STACK
if (type == SOCK_DGRAM && (protocol == 0 || protocol == IPPROTO_UDP))
if ((type == SOCK_DGRAM || type == SOCK_CTRL) &&
(protocol == 0 || protocol == IPPROTO_UDP))
{
return &g_inet_sockif;
}
else
#endif
#ifdef NET_TCP_HAVE_STACK
if (type == SOCK_STREAM && (protocol == 0 || protocol == IPPROTO_TCP))
if ((type == SOCK_STREAM || type == SOCK_CTRL) &&
(protocol == 0 || protocol == IPPROTO_TCP))
{
return &g_inet_sockif;
}
Expand Down

0 comments on commit ce8b377

Please sign in to comment.