Skip to content

Commit a58e2b6

Browse files
committed
lwIP-v2: new patch to randomize tcp source ports
ref: d-a-v/esp82xx-nonos-linklayer#31 origin: esp8266#5902
1 parent 7a2e935 commit a58e2b6

File tree

8 files changed

+18
-2
lines changed

8 files changed

+18
-2
lines changed

tools/sdk/lib/liblwip2-1460-feat.a

9.71 KB
Binary file not shown.

tools/sdk/lib/liblwip2-1460.a

9.69 KB
Binary file not shown.

tools/sdk/lib/liblwip2-536-feat.a

9.71 KB
Binary file not shown.

tools/sdk/lib/liblwip2-536.a

9.69 KB
Binary file not shown.

tools/sdk/lwip2/include/gluedebug.h

+10
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
#define ULWIPDEBUG 0 // 0 or 1 (trigger lwip debug)
1919
#define ULWIPASSERT 0 // 0 or 1 (trigger lwip self-check, 0 saves flash)
2020

21+
#if ARDUINO
2122
#define STRING_IN_FLASH 1 // *print("fmt is stored in flash")
23+
#else
24+
#define STRING_IN_FLASH 0 // *print("fmt is stored in flash")
25+
#endif
2226

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

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

4145
/////////////////////////////////////////////////////////////////////////////
46+
#if ARDUINO
4247
#include <sys/pgmspace.h>
48+
#endif
4349

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

103+
#if ARDUINO
97104
#define udoassert(assertion...) \
98105
do { if ((assertion) == 0) { \
99106
static const char assrt[] ICACHE_RODATA_ATTR STORE_ATTR = #assertion " wrong@"; \
@@ -104,6 +111,9 @@ do { if ((assertion) == 0) { \
104111
os_printf_plus(assrt_line, __LINE__); \
105112
uhalt(); \
106113
} } while (0)
114+
#else
115+
#define udoassert(assertion...) do { if ((assertion) == 0) { os_printf("assert fail: " #assertion " @%s:%d\n", __FILE__, __LINE__); uhalt(); } } while (0)
116+
#endif
107117

108118
#if UNDEBUG
109119
#define uassert(assertion...) do { (void)0; } while (0)
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// generated by makefiles/make-lwip2-hash
22
#ifndef LWIP_HASH_H
33
#define LWIP_HASH_H
4-
#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.1-2-ga501b57"
4+
#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.1-5-g25d5e81"
55
#endif // LWIP_HASH_H

tools/sdk/lwip2/include/lwipopts.h

+6
Original file line numberDiff line numberDiff line change
@@ -3534,6 +3534,12 @@
35343534
#error LWIP_FEATURES must be defined
35353535
#endif
35363536

3537+
3538+
/**
3539+
* TCP_RANDOM_PORT: randomize port instead of simply increasing
3540+
*/
3541+
#define TCP_RANDOM_PORT 1
3542+
35373543
/*
35383544
--------------------------------------------------
35393545
------------------ SNTP options ------------------

0 commit comments

Comments
 (0)