Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/lwip/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
INCLUDES += -I$(RIOTBASE)/pkg/lwip/include \
-I$(PKGDIRBASE)/lwip/src/include
-I$(PKGDIRBASE)/lwip/src/include \
-I$(PKGDIRBASE)/lwip/src/include/compat/posix

PSEUDOMODULES += lwip_arp
PSEUDOMODULES += lwip_autoip
Expand Down
2 changes: 2 additions & 0 deletions pkg/lwip/include/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "byteorder.h"
#include "mutex.h"

#include "sys/time.h"

#ifdef MODULE_LOG
#include "log.h"
#endif
Expand Down
14 changes: 13 additions & 1 deletion pkg/lwip/include/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,13 @@ extern "C" {
#endif /* MODULE_LWIP_SOCK */

#ifdef MODULE_SHELL_COMMANDS
#if LWIP_DEBUG_ENABLED == 1
#define LWIP_DEBUG 0
#define SOCKETS_DEBUG LWIP_DBG_ON
#else
#define LWIP_DEBUG 1
#endif
#endif

#ifndef TCP_LISTEN_BACKLOG
# if defined(MODULE_LWIP_SOCK_TCP)
Expand All @@ -155,7 +160,7 @@ extern "C" {
# endif
#endif /* TCP_LISTEN_BACKLOG */

#define LWIP_SOCKET 0
#define LWIP_SOCKET 1

#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
#define MEMP_MEM_MALLOC 1
Expand All @@ -171,6 +176,13 @@ extern "C" {
#define MEM_SIZE (TCPIP_THREAD_STACKSIZE + 6144)
#endif

#if MBEDTLS_ENABLED == 1
#define LWIP_DNS 1
#define LWIP_TIMEVAL_PRIVATE 0
#define LWIP_POSIX_SOCKETS_IO_NAMES 1
#define SO_REUSE 1
#endif

#ifdef DEVELHELP
void sys_mark_tcpip_thread(void);
#define LWIP_MARK_TCPIP_THREAD sys_mark_tcpip_thread
Expand Down
14 changes: 14 additions & 0 deletions pkg/lwip/include/netdb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef NETDB_H
#define NETDB_H

#ifdef __cplusplus
extern "C" {
#endif

#include "lwip/netdb.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this and the other one can be a symlink instead? It seems they are already used in the tree.


#ifdef __cplusplus
}
#endif

#endif /* NETDB_H */
14 changes: 14 additions & 0 deletions pkg/lwip/include/netinet/in.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef NETINET_IN_H
#define NETINET_IN_H

#ifdef __cplusplus
extern "C" {
#endif

#include "lwip/inet.h"

#ifdef __cplusplus
}
#endif

#endif /* NETINET_IN_H */
39 changes: 39 additions & 0 deletions pkg/lwip/patches/0001-lwip-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 517bc69a216e48ab82542e1d5ec6f3846af80e84 Mon Sep 17 00:00:00 2001
From: "mariem.charrada" <mariem.charrada@ml-pa.com>
Date: Tue, 25 Jan 2022 07:33:46 +0100
Subject: [PATCH] lwip-patch

---
src/core/dns.c | 1 +
src/include/lwip/sockets.h | 2 ++
2 files changed, 3 insertions(+)

diff --git a/src/core/dns.c b/src/core/dns.c
index 9d2f61ed..e8d9950e 100644
--- a/src/core/dns.c
+++ b/src/core/dns.c
@@ -94,6 +94,7 @@
#include "lwip/memp.h"
#include "lwip/dns.h"
#include "lwip/prot/dns.h"
+#include "lwip/sys.h"

#include <string.h>

diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h
index d70d36c4..f62b7dd7 100644
--- a/src/include/lwip/sockets.h
+++ b/src/include/lwip/sockets.h
@@ -671,7 +671,9 @@ int lwip_inet_pton(int af, const char *src, void *dst);
/** @ingroup socket */
#define close(s) lwip_close(s)
/** @ingroup socket */
+#if MBEDTLS_ENABLED == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please edit the patch to explain why this is done.

#define fcntl(s,cmd,val) lwip_fcntl(s,cmd,val)
+#endif
/** @ingroup socket */
#define ioctl(s,cmd,argp) lwip_ioctl(s,cmd,argp)
#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */
--
2.25.1

Loading