2
0
Fork 0

fixup lwip patch

This commit is contained in:
Ehmry - 2020-11-10 15:50:49 +01:00
parent eabcdf475b
commit 759eec4e00
1 changed files with 33 additions and 18 deletions

View File

@ -1,25 +1,28 @@
From ecd90bc782f50b815fcc68e59de0c92907b6fefb Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net>
Date: Mon, 9 Nov 2020 23:08:08 +0100
Subject: [PATCH] lwip: bring interface up after configuring
Calling netif_set_up before netif_set_netmask and netif_set_gw will bring
the interface up successfully but triggers misleading log messages.
---
repos/libports/include/lwip/nic_netif.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/repos/libports/include/lwip/nic_netif.h b/repos/libports/include/lwip/nic_netif.h
index 167abecb3f..426b17cf8b 100644
index 167abecb3f..6b11a5c28f 100644
--- a/repos/libports/include/lwip/nic_netif.h
+++ b/repos/libports/include/lwip/nic_netif.h
@@ -17,6 +17,8 @@
#ifndef __LWIP__NIC_NETIF_H__
#define __LWIP__NIC_NETIF_H__
@@ -181,8 +181,6 @@ class Lwip::Nic_netif
return;
}
+#include <base/debug.h>
+
#if ETH_PAD_SIZE
#error ETH_PAD_SIZE defined but unsupported by lwip/nic_netif.h
#endif
@@ -194,6 +196,7 @@ class Lwip::Nic_netif
if (config.has_attribute("netmask")) {
Str str = config.attribute_value("netmask", Str());
+ PDBG("netmask is ", str);
ip_addr_t ip;
ipaddr_aton(str.string(), &ip);
netif_set_netmask(&_netif, ip_2_ip4(&ip));
@@ -205,7 +208,6 @@ class Lwip::Nic_netif
- netif_set_up(&_netif);
-
if (ip_str != "") {
ip_addr_t ipaddr;
if (!ipaddr_aton(ip_str.string(), &ipaddr)) {
@@ -205,7 +203,6 @@ class Lwip::Nic_netif
ipaddr_aton(str.string(), &ip);
netif_set_gw(&_netif, ip_2_ip4(&ip));
}
@ -27,3 +30,15 @@ index 167abecb3f..426b17cf8b 100644
}
if (config.has_attribute("nameserver")) {
@@ -220,6 +217,8 @@ class Lwip::Nic_netif
dns_setserver(0, &ip);
}
+ netif_set_up(&_netif);
+
handle_link_state();
}
--
2.28.0