Skip to content

lwIP-v2: new patch to randomize tcp source ports #5906

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Merged
merged 2 commits into from
Apr 5, 2019
Merged
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
Binary file modified tools/sdk/lib/liblwip2-1460-feat.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblwip2-1460.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblwip2-536-feat.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblwip2-536.a
Binary file not shown.
10 changes: 10 additions & 0 deletions tools/sdk/lwip2/include/gluedebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#define ULWIPDEBUG 0 // 0 or 1 (trigger lwip debug)
#define ULWIPASSERT 0 // 0 or 1 (trigger lwip self-check, 0 saves flash)

#if ARDUINO
#define STRING_IN_FLASH 1 // *print("fmt is stored in flash")
#else
#define STRING_IN_FLASH 0 // *print("fmt is stored in flash")
#endif

#define ROTBUFLEN_BIT 11 // (UDEBUGSTORE=1) doprint()'s buffer: 11=2048B

Expand All @@ -39,7 +43,9 @@ extern "C"
void (*phy_capture) (int netif_idx, const char* data, size_t len, int out, int success);

/////////////////////////////////////////////////////////////////////////////
#if ARDUINO
#include <sys/pgmspace.h>
#endif

#if UDEBUG && UDEBUGSTORE
#warning use 'doprint_allow=1' right after Serial is enabled
Expand Down Expand Up @@ -94,6 +100,7 @@ int doprint_minus (const char* format, ...) __attribute__ ((format (printf, 1, 2
#define uprint(x...) do { (void)0; } while (0)
#endif

#if ARDUINO
#define udoassert(assertion...) \
do { if ((assertion) == 0) { \
static const char assrt[] ICACHE_RODATA_ATTR STORE_ATTR = #assertion " wrong@"; \
Expand All @@ -104,6 +111,9 @@ do { if ((assertion) == 0) { \
os_printf_plus(assrt_line, __LINE__); \
uhalt(); \
} } while (0)
#else
#define udoassert(assertion...) do { if ((assertion) == 0) { os_printf("assert fail: " #assertion " @%s:%d\n", __FILE__, __LINE__); uhalt(); } } while (0)
#endif

#if UNDEBUG
#define uassert(assertion...) do { (void)0; } while (0)
Expand Down
2 changes: 1 addition & 1 deletion tools/sdk/lwip2/include/lwip-git-hash.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// generated by makefiles/make-lwip2-hash
#ifndef LWIP_HASH_H
#define LWIP_HASH_H
#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.1-2-ga501b57"
#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.1-5-g25d5e81"
#endif // LWIP_HASH_H
6 changes: 6 additions & 0 deletions tools/sdk/lwip2/include/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -3534,6 +3534,12 @@
#error LWIP_FEATURES must be defined
#endif


/**
* TCP_RANDOM_PORT: randomize port instead of simply increasing
*/
#define TCP_RANDOM_PORT 1

/*
--------------------------------------------------
------------------ SNTP options ------------------
Expand Down