forked from nuttx/nuttx-update
net/inet: Only setup poll for UDP when s_type == SOCK_DGRAM
Problem: A SOCK_CTRL socket may be led to udp_pollsetup but never reaches udp_pollteardown, it seems that we shouldn't call udp_pollsetup for other socket types. Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
0550082966
commit
61ff04b9e2
1 changed files with 1 additions and 1 deletions
|
@ -1503,7 +1503,7 @@ static inline int inet_pollsetup(FAR struct socket *psock,
|
|||
else
|
||||
#endif /* NET_TCP_HAVE_STACK */
|
||||
#ifdef NET_UDP_HAVE_STACK
|
||||
if (psock->s_type != SOCK_STREAM)
|
||||
if (psock->s_type == SOCK_DGRAM)
|
||||
{
|
||||
return udp_pollsetup(psock, fds);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue