net/netdev: add devif_loopback_out() to check the loopback case where a packet is being sent to itself. Modify the net driver to call this function in this case. This function will simply re-inject the packet back into the network and the network driver will not put anything on the wire.

This commit is contained in:
Xiang Xiao
2018-08-24 09:21:33 -06:00
committed by Gregory Nutt
parent f74ddd2a04
commit 0074afa0ac
33 changed files with 639 additions and 366 deletions
+8 -5
View File
@@ -334,13 +334,16 @@ static int misoc_net_txpoll(FAR struct net_driver_s *dev)
}
#endif /* CONFIG_NET_IPv6 */
/* Send the packet */
if (!devif_loopback_out(&priv->misoc_net_dev))
{
/* Send the packet */
misoc_net_transmit(priv);
misoc_net_transmit(priv);
/* Check if there is room in the device to hold another packet. If not,
* return a non-zero value to terminate the poll.
*/
/* Check if there is room in the device to hold another packet. If not,
* return a non-zero value to terminate the poll.
*/
}
}
/* If zero is returned, the polling will continue until all connections have