]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
Point to Unikraft's lwIP fork
authorSimon Kuenzer <simon.kuenzer@neclab.eu>
Mon, 16 Aug 2021 13:29:18 +0000 (15:29 +0200)
committerUnikraft <monkey@unikraft.io>
Fri, 12 Nov 2021 14:55:31 +0000 (15:55 +0100)
With this commit the build system is going to download lwIP
2.1.2 from our official fork on GitHub. Some patch files had
to be adopted (whitespaces) to still apply.

Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #9

Makefile.uk
patches/0001-timeval-for-socket-c.patch
patches/0002-Don-t-provide-file-status-flags-when-we-have-a-libc.patch
patches/0003-Declare-mem_-functions-only-for-lwip-internal-use.patch
patches/0004-src-include-lwip-sockets.h-Add-ipi_spec_dst-field-to.patch
patches/0005-patches-Add-more-fields-to-struct-ifreq.patch

index fb612ed1b6b018438bb2f8c8cfea14fa87ebeb20..54a4ed7cb9675d19df728251b70b2219893c7ee3 100644 (file)
@@ -41,8 +41,11 @@ $(eval $(call addlib_s,liblwip,$(CONFIG_LIBLWIP)))
 ################################################################################
 # Sources
 ################################################################################
-LIBLWIP_ZIPNAME=lwip-2.1.2
-LIBLWIP_URL=http://download.savannah.nongnu.org/releases/lwip/$(LIBLWIP_ZIPNAME).zip
+LIBLWIP_TAG=STABLE-2_1_2_RELEASE
+LIBLWIP_ZIPNAME=fork-lwip-$(LIBLWIP_TAG)
+LIBLWIP_URL=https://github.com/unikraft/fork-lwip/archive/refs/tags/$(LIBLWIP_TAG).zip
+LIBLWIP_ORIGIN_SHA256=8f0ae46e2702720ce852b00de5d304adb2809b0203741f299876594bb8be7890
+
 LIBLWIP_PATCHDIR=$(LIBLWIP_BASE)/patches
 $(eval $(call fetch,liblwip,$(LIBLWIP_URL)))
 $(eval $(call patch,liblwip,$(LIBLWIP_PATCHDIR),$(LIBLWIP_ZIPNAME)))
@@ -69,7 +72,7 @@ LIBLWIP_CFLAGS-y += -Wno-type-limits -Wno-unused-parameter
 LIBLWIP_CFLAGS-$(CONFIG_LWIP_DEBUG) += -DUK_DEBUG
 LIBLWIP_CFLAGS-y   += -D__IN_LIBLWIP__
 LIBLWIP_CXXFLAGS-y += -D__IN_LIBLWIP__
-       
+
 ################################################################################
 # Core
 ################################################################################
index f1663ef88932f089329fb067d21f84d48d7c21d4..4fdec7785e704f270bdd1f249ea859f15a82be01 100644 (file)
@@ -1,11 +1,11 @@
 --- a/src/api/sockets.c        2018-03-05 16:12:39.917974880 +0100
 +++ b/src/api/sockets.c        2018-03-05 16:12:24.577997842 +0100
 @@ -44,6 +44,8 @@
-  *\r
-  */\r
\r
-+#include <sys/time.h>\r
-+\r
- #include "lwip/opt.h"\r
\r
- #if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */\r
+  *
+  */
++#include <sys/time.h>
++
+ #include "lwip/opt.h"
+ #if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
index 34a42381fd4a361ca96c62b326b65fd0109a247a..627b6c2398c563178ffe66fc6aeb9fcd643765f4 100644 (file)
@@ -17,30 +17,30 @@ index d70d36c4..72169cd0 100644
 --- a/src/include/lwip/sockets.h
 +++ b/src/include/lwip/sockets.h
 @@ -39,6 +39,8 @@
- #ifndef LWIP_HDR_SOCKETS_H\r
- #define LWIP_HDR_SOCKETS_H\r
\r
-+#include <uk/config.h>\r
-+\r
- #include "lwip/opt.h"\r
\r
- #if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */\r
-@@ -438,6 +440,7 @@ typedef struct ipv6_mreq {\r
- #define F_SETFL 4\r
- #endif\r
\r
-+#ifndef CONFIG_HAVE_LIBC\r
- /* File status flags and file access modes for fnctl,\r
-    these are bits in an int. */\r
- #ifndef O_NONBLOCK\r
-@@ -455,6 +458,7 @@ typedef struct ipv6_mreq {\r
- #ifndef O_RDWR\r
- #define O_RDWR      (O_RDONLY|O_WRONLY)\r
- #endif\r
-+#endif /* CONFIG_HAVE_LIBC */\r
\r
- #ifndef SHUT_RD\r
-   #define SHUT_RD   0\r
+ #ifndef LWIP_HDR_SOCKETS_H
+ #define LWIP_HDR_SOCKETS_H
++#include <uk/config.h>
++
+ #include "lwip/opt.h"
+ #if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
+@@ -447,6 +449,7 @@ typedef struct ipv6_mreq {
+ #define F_SETFL 4
+ #endif
++#ifndef CONFIG_HAVE_LIBC
+ /* File status flags and file access modes for fnctl,
+    these are bits in an int. */
+ #ifndef O_NONBLOCK
+@@ -464,6 +467,7 @@ typedef struct ipv6_mreq {
+ #ifndef O_RDWR
+ #define O_RDWR      (O_RDONLY|O_WRONLY)
+ #endif
++#endif /* CONFIG_HAVE_LIBC */
+ #ifndef SHUT_RD
+   #define SHUT_RD   0
 -- 
 2.21.0
 
index c43106ad371c48c1758089aaba85df72d9497b9f..c92476d83d237e253ea554f2b040c4528be532ec 100644 (file)
@@ -1,16 +1,16 @@
 --- a/src/include/lwip/mem.h
 +++ b/src/include/lwip/mem.h
 @@ -69,11 +69,13 @@
- #endif /* MEM_SIZE > 64000 */\r
- #endif\r
\r
-+#ifdef __IN_LIBLWIP__\r
- void  mem_init(void);\r
- void *mem_trim(void *mem, mem_size_t size);\r
- void *mem_malloc(mem_size_t size);\r
- void *mem_calloc(mem_size_t count, mem_size_t size);\r
- void  mem_free(void *mem);\r
-+#endif\r
\r
- #ifdef __cplusplus\r
- }\r
+ #endif /* MEM_SIZE > 64000 */
+ #endif
++#ifdef __IN_LIBLWIP__
+ void  mem_init(void);
+ void *mem_trim(void *mem, mem_size_t size);
+ void *mem_malloc(mem_size_t size);
+ void *mem_calloc(mem_size_t count, mem_size_t size);
+ void  mem_free(void *mem);
++#endif
+ #ifdef __cplusplus
+ }
index f4661a86180603ac5984f6bcf381e5ca8d349f0a..f9673f718cfd45be90a6d7a376e75290ea89a767 100644 (file)
@@ -3,10 +3,10 @@ index ace9885..4e333ae 100644
 --- a/src/include/lwip/sockets.h
 +++ b/src/include/lwip/sockets.h
 @@ -327,6 +327,7 @@ typedef struct ip_mreq {
- #if LWIP_IPV4\r
- struct in_pktinfo {\r
-   unsigned int   ipi_ifindex;  /* Interface index */\r
+ #if LWIP_IPV4
+ struct in_pktinfo {
+   unsigned int   ipi_ifindex;  /* Interface index */
 +  struct in_addr ipi_spec_dst;        /* Routing destination address  */
-   struct in_addr ipi_addr;     /* Destination (from header) address */\r
- };\r
- #endif /* LWIP_IPV4 */\r
+   struct in_addr ipi_addr;     /* Destination (from header) address */
+ };
+ #endif /* LWIP_IPV4 */
index aa8126c13908a8847d87418215d1da3897e9f339..db5e95df46f166940a6f8e0fe920e71f120201bf 100644 (file)
@@ -3,9 +3,9 @@ index ace9885..a6cec38 100644
 --- a/src/include/lwip/sockets.h
 +++ b/src/include/lwip/sockets.h
 @@ -184,8 +184,38 @@ will need to increase long long */
- #define IFNAMSIZ NETIF_NAMESIZE\r
- struct ifreq {\r
-   char ifr_name[IFNAMSIZ]; /* Interface name */\r
+ #define IFNAMSIZ NETIF_NAMESIZE
+ struct ifreq {
+   char ifr_name[IFNAMSIZ]; /* Interface name */
 +      union {
 +              struct sockaddr ifru_addr;
 +              struct sockaddr ifru_dstaddr;
@@ -20,8 +20,8 @@ index ace9885..a6cec38 100644
 +              char ifru_newname[IFNAMSIZ];
 +              char *ifru_data;
 +      } ifr_ifru;
- };\r
\r
+ };
 +#define ifr_hwaddr    ifr_ifru.ifru_hwaddr
 +#define ifr_addr      ifr_ifru.ifru_addr
 +#define ifr_dstaddr   ifr_ifru.ifru_dstaddr
@@ -38,6 +38,6 @@ index ace9885..a6cec38 100644
 +#define ifr_qlen      ifr_ifru.ifru_ivalue
 +#define ifr_newname   ifr_ifru.ifru_newname
 +
- /* Socket protocol types (TCP/UDP/RAW) */\r
- #define SOCK_STREAM     1\r
- #define SOCK_DGRAM      2\r
+ /* Socket protocol types (TCP/UDP/RAW) */
+ #define SOCK_STREAM     1
+ #define SOCK_DGRAM      2