From: Joan Lledó <[email protected]>

Get the value from gnumach. Set NETIF_FLAG_LINK_UP in lwip according to it
---
 lwip/port/netif/hurdethif.c | 8 +++++---
 lwip/port/netif/ifcommon.c  | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lwip/port/netif/hurdethif.c b/lwip/port/netif/hurdethif.c
index 84eb7db7..03702813 100644
--- a/lwip/port/netif/hurdethif.c
+++ b/lwip/port/netif/hurdethif.c
@@ -528,15 +528,17 @@ hurdethif_device_init (struct netif *netif)
   /* Enable Ethernet multicasting */
   hurdethif_device_get_flags (netif, &netif_get_state (netif)->flags);
   netif_get_state (netif)->flags |=
-    IFF_UP | IFF_RUNNING | IFF_BROADCAST | IFF_ALLMULTI;
+    IFF_UP | IFF_BROADCAST | IFF_ALLMULTI;
   hurdethif_device_set_flags (netif, netif_get_state (netif)->flags);
 
   /*
    * Up the link, set the interface type to NETIF_FLAG_ETHARP
    * and enable other features.
    */
-  netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP
-    | NETIF_FLAG_IGMP | NETIF_FLAG_MLD6;
+  netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP | 
NETIF_FLAG_MLD6;
+
+  if (netif_get_state (netif)->flags & IFF_RUNNING)
+    netif->flags |= NETIF_FLAG_LINK_UP;
 
   return ERR_OK;
 }
diff --git a/lwip/port/netif/ifcommon.c b/lwip/port/netif/ifcommon.c
index 8a18f1d6..cc4290a0 100644
--- a/lwip/port/netif/ifcommon.c
+++ b/lwip/port/netif/ifcommon.c
@@ -39,7 +39,7 @@ if_open (struct netif *netif)
   if (!err)
     {
       /* Up the inerface */
-      ifc->flags |= IFF_UP | IFF_RUNNING;
+      ifc->flags |= IFF_UP;
       netif_set_up (netif);
     }
 
-- 
2.50.1


Reply via email to