net/devif_loopback: Add robustness to avoid infinite loop
When ipv4_input/ipv6_input called by devif_loopback writes wrong data into buffer (another bug we're fixing), the else block does nothing but only record the 'dropped' statistic, then infinite loop happens.
Refers to previous lo device with dropping logic:
@@ -119,7 +119,9 @@ int devif_loopback(FAR struct net_driver_s *dev)
else
#endif
{
+ nwarn("WARNING: Unrecognized IP version\n");
NETDEV_RXDROPPED(dev);
+ dev->d_len = 0;
}
NETDEV_TXDONE(dev);
