net/: icmp[v6]_pollsetup should always return POLLWRNORM if the caller requests it since ICMP[v6] doesn't utilize IOB buffer for sending and always needs to wait for an ICMP[v6]_POLL.
This commit is contained in:
parent
ea666877f2
commit
250bde034d
@ -137,13 +137,6 @@ static uint16_t icmp_poll_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
eventset |= (POLLHUP | POLLERR);
|
eventset |= (POLLHUP | POLLERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ICMP_POLL is a sign that we are free to send data. */
|
|
||||||
|
|
||||||
else if ((flags & DEVPOLL_MASK) == ICMP_POLL)
|
|
||||||
{
|
|
||||||
eventset |= (POLLOUT & info->fds->events);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Awaken the caller of poll() is requested event occurred. */
|
/* Awaken the caller of poll() is requested event occurred. */
|
||||||
|
|
||||||
if (eventset)
|
if (eventset)
|
||||||
@ -221,11 +214,6 @@ int icmp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
cb->priv = (FAR void *)info;
|
cb->priv = (FAR void *)info;
|
||||||
cb->event = icmp_poll_eventhandler;
|
cb->event = icmp_poll_eventhandler;
|
||||||
|
|
||||||
if ((fds->events & POLLOUT) != 0)
|
|
||||||
{
|
|
||||||
cb->flags |= ICMP_POLL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((fds->events & POLLIN) != 0)
|
if ((fds->events & POLLIN) != 0)
|
||||||
{
|
{
|
||||||
cb->flags |= ICMP_NEWDATA;
|
cb->flags |= ICMP_NEWDATA;
|
||||||
@ -246,6 +234,12 @@ int icmp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
fds->revents |= (POLLRDNORM & fds->events);
|
fds->revents |= (POLLRDNORM & fds->events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Always report POLLWRNORM if caller request it because we don't utilize
|
||||||
|
* IOB buffer for sending.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fds->revents |= (POLLWRNORM & fds->events);
|
||||||
|
|
||||||
/* Check if any requested events are already in effect */
|
/* Check if any requested events are already in effect */
|
||||||
|
|
||||||
if (fds->revents != 0)
|
if (fds->revents != 0)
|
||||||
|
@ -137,13 +137,6 @@ static uint16_t icmpv6_poll_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
eventset |= (POLLHUP | POLLERR);
|
eventset |= (POLLHUP | POLLERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ICMP_POLL is a sign that we are free to send data. */
|
|
||||||
|
|
||||||
else if ((flags & DEVPOLL_MASK) == ICMPv6_POLL)
|
|
||||||
{
|
|
||||||
eventset |= (POLLOUT & info->fds->events);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Awaken the caller of poll() is requested event occurred. */
|
/* Awaken the caller of poll() is requested event occurred. */
|
||||||
|
|
||||||
if (eventset)
|
if (eventset)
|
||||||
@ -219,11 +212,6 @@ int icmpv6_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
cb->priv = (FAR void *)info;
|
cb->priv = (FAR void *)info;
|
||||||
cb->event = icmpv6_poll_eventhandler;
|
cb->event = icmpv6_poll_eventhandler;
|
||||||
|
|
||||||
if ((fds->events & POLLOUT) != 0)
|
|
||||||
{
|
|
||||||
cb->flags |= ICMPv6_POLL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((fds->events & POLLIN) != 0)
|
if ((fds->events & POLLIN) != 0)
|
||||||
{
|
{
|
||||||
cb->flags |= ICMPv6_NEWDATA;
|
cb->flags |= ICMPv6_NEWDATA;
|
||||||
@ -244,6 +232,12 @@ int icmpv6_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
fds->revents |= (POLLRDNORM & fds->events);
|
fds->revents |= (POLLRDNORM & fds->events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Always report POLLWRNORM if caller request it because we don't utilize
|
||||||
|
* IOB buffer for sending.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fds->revents |= (POLLWRNORM & fds->events);
|
||||||
|
|
||||||
/* Check if any requested events are already in effect */
|
/* Check if any requested events are already in effect */
|
||||||
|
|
||||||
if (fds->revents != 0)
|
if (fds->revents != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user