mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
Local loopback: Set the IFF_UP flags during initialization because the local loopback device is always up
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/irq.h>
|
||||
@@ -532,13 +533,16 @@ int localhost_initialize(void)
|
||||
net_ipv4addr_copy(priv->lo_dev.d_draddr, g_lo_ipv4addr);
|
||||
net_ipv4addr_copy(priv->lo_dev.d_netmask, g_lo_ipv4mask);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
net_ipv6addr_copy(priv->lo_dev.d_ipv6addr, g_lo_ipv6addr);
|
||||
net_ipv6addr_copy(priv->lo_dev.d_ipv6draddr, g_lo_ipv6addr);
|
||||
net_ipv6addr_copy(priv->lo_dev.d_ipv6netmask, g_ipv6_alloneaddr);
|
||||
#endif
|
||||
|
||||
/* Put the network in the UP state */
|
||||
|
||||
priv->lo_dev.d_flags = IFF_UP;
|
||||
return lo_ifup(&priv->lo_dev);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user