Dispatch ICMP_POLL to device's callback list too since icmpv6_neighbor still append the callback into this list.

This commit is contained in:
Gregory Nutt 2019-09-20 07:54:10 -06:00
parent f4cc21a5c3
commit 23e1d2e403
2 changed files with 7 additions and 3 deletions

View File

@ -365,9 +365,12 @@ static inline int devif_poll_icmpv6(FAR struct net_driver_s *dev,
/* Traverse all of the allocated ICMPV6 connections and perform the poll action */
while (!bstop && (conn = icmpv6_nextconn(conn)) != NULL)
do
{
/* Perform the ICMPV6 poll */
/* Perform the ICMPV6 poll
* Note: conn equal NULL in the first iteration means poll dev's callback list
* since icmpv6_neighbor still append it's callback into this list.
*/
icmpv6_poll(dev, conn);
@ -379,6 +382,7 @@ static inline int devif_poll_icmpv6(FAR struct net_driver_s *dev,
bstop = callback(dev);
}
while (!bstop && (conn = icmpv6_nextconn(conn)) != NULL);
return bstop;
}

View File

@ -83,7 +83,7 @@ void icmpv6_poll(FAR struct net_driver_s *dev,
/* Perform the application callback */
(void)devif_conn_event(dev, conn, ICMPv6_POLL, conn->list);
devif_conn_event(dev, conn, ICMPv6_POLL, conn ? conn->list : &dev->d_conncb);
}
#endif /* CONFIG_NET_ICMPv6_SOCKET || CONFIG_NET_ICMPv6_NEIGHBOR */