From 759eec4e0095f5b4a176f56a55fd769b050a340c Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 10 Nov 2020 15:50:49 +0100 Subject: [PATCH] fixup lwip patch --- packages/genodelabs/lwip.patch | 51 ++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/packages/genodelabs/lwip.patch b/packages/genodelabs/lwip.patch index 93e8d58..70d1b9b 100644 --- a/packages/genodelabs/lwip.patch +++ b/packages/genodelabs/lwip.patch @@ -1,25 +1,28 @@ +From ecd90bc782f50b815fcc68e59de0c92907b6fefb Mon Sep 17 00:00:00 2001 +From: Emery Hemingway +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 -+ - #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 +