mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
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:
committed by
Alan Carvalho de Assis
parent
0550082966
commit
61ff04b9e2
@@ -1503,7 +1503,7 @@ static inline int inet_pollsetup(FAR struct socket *psock,
|
|||||||
else
|
else
|
||||||
#endif /* NET_TCP_HAVE_STACK */
|
#endif /* NET_TCP_HAVE_STACK */
|
||||||
#ifdef NET_UDP_HAVE_STACK
|
#ifdef NET_UDP_HAVE_STACK
|
||||||
if (psock->s_type != SOCK_STREAM)
|
if (psock->s_type == SOCK_DGRAM)
|
||||||
{
|
{
|
||||||
return udp_pollsetup(psock, fds);
|
return udp_pollsetup(psock, fds);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user