net/arp and net/icmpv6: don't call d_txavail directly since it may point to NULL

This commit is contained in:
Xiang Xiao 2018-11-09 11:22:58 -06:00 committed by Gregory Nutt
parent f036e2a32a
commit 26ae4176f0
3 changed files with 4 additions and 11 deletions

View File

@ -342,16 +342,9 @@ int arp_send(in_addr_t ipaddr)
state.snd_cb->priv = (FAR void *)&state;
state.snd_cb->event = arp_send_eventhandler;
/* Notify the device driver that new TX data is available.
* NOTES: This is in essence what netdev_ipv4_txnotify() does, which
* is not possible to call since it expects a in_addr_t as
* its single argument to lookup the network interface.
*/
/* Notify the device driver that new TX data is available. */
if (dev->d_txavail)
{
dev->d_txavail(dev);
}
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_lockedwait will also terminate if a signal is received.

View File

@ -243,7 +243,7 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, bool advertise)
/* Notify the device driver that new TX data is available. */
dev->d_txavail(dev);
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur
* net_lockedwait will also terminate if a signal is received.

View File

@ -349,7 +349,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
/* Notify the device driver that new TX data is available. */
dev->d_txavail(dev);
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_lockedwait will also terminate if a signal is received.