Joel Cunningham
ad779e5c9c
doc: clarify RST handling comment
...
This clarifies the documentation around RST handling to document
the approach follows RFC 5961 and is not a standards violation
2017-04-21 09:27:54 -05:00
goldsimon
f4730e78f8
sntp: use randomized startup delay ([0..5] seconds) by default (if LWIP_RAND is available)
2017-04-21 13:14:48 +02:00
goldsimon
65b8316459
sntp_opts.h: adapt comment to RFC errata
2017-04-21 13:14:03 +02:00
goldsimon
554f5d7f9e
sntp: fix SNTP_LI_* bits; fix todo comment
2017-04-21 13:13:56 +02:00
goldsimon
84461e90e2
mqtt: fix shadowing global 'dup'
2017-04-21 07:23:32 +02:00
goldsimon
a50ba9c748
sockets.c: try to fix debug print (again)
2017-04-20 23:03:49 +02:00
Joel Cunningham
de90d03e48
tcp: task #14128 - Appropriate Byte Counting support
...
This commit adds TCP Appropriate Byte Counting (ABC) support based on
RFC 3465
ABC replaces the previous congestion window growth mechanism and has been
configured with limit of 2 SMSS. See task #14128 for discussion on
defaults, but the goal is to mitigate the performance impact of delayed
ACKs on congestion window growth
This commit also introduces a mechanism to track when the stack is
undergoing a period following an RTO where data is being retransmitted.
Lastly, this adds a unit test to verify RTO period tracking and some
basic ABC cwnd checking
2017-04-20 15:59:24 -05:00
goldsimon
e1f2c8b30c
sockets.c: try to fix debug print
2017-04-20 22:55:56 +02:00
goldsimon
2358a5ac32
lwip_netconn_do_close_internal: 'close' -> 'shut_close': don't override global function names (why is this reported only now?)
2017-04-20 22:52:27 +02:00
goldsimon
2c767a1d60
fix standard conformance: some socket functions should return 'ssize_t', not 'int'
2017-04-20 22:44:23 +02:00
goldsimon
1ada106d61
netconn_tcp_recvd: take size_t, not u32_t
2017-04-20 22:34:12 +02:00
goldsimon
4d6b90727f
lwip_recvfrom: use LWIP_MIN instead of self-coded min
2017-04-20 22:07:08 +02:00
goldsimon
dbc969c139
Try to fix the socket API for sizeof(int) <= 2 by checking INT_MAX at 2 places
2017-04-20 22:06:36 +02:00
goldsimon
b93572dca8
Document struct netvector
2017-04-20 22:00:07 +02:00
goldsimon
131d656c23
lwip_itoa: check 'bufsize' instead of ignoring it; ensure code is not stolen from GPL
2017-04-20 21:57:03 +02:00
goldsimon
3770adccfd
Fixed bug #50838 (mem.c needs SYS_ARCH_PROTECTION around MEM_STATS)
2017-04-20 21:44:00 +02:00
Dirk Ziegelmeier
d54240bdea
One more try to fix compile without TCP
2017-04-19 08:44:05 +02:00
Dirk Ziegelmeier
302d84f5b2
Try to fix compile without TCP (reported by Axel Lin)
2017-04-19 08:18:15 +02:00
Dirk Ziegelmeier
32aa9a41e2
Apply patch from Kudratov Olimjon: Array index used before limits check
...
while ((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
should be
while ((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) {
See https://jira.reactos.org/browse/CORE-8978 for more info.
2017-04-19 06:35:07 +02:00
Tim Cussins
8e83e206f4
sockets.c: Make sock_inc_used overflow check robust.
...
Before this patch, it was possible that the overflow check might
miss an overflow event.
e.g. Consider 2 threads, both executing this method. u8_t fd_used is on 255...
Thread A -> atomically increment fd_used (which is now 0)
Thread B -> atomically increment fd_used (which is now 1)
Thread A -> check overflow... sees everything ok
Thread B -> check overflow... sees everything ok
And the overflow is missed :(
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-04-18 20:50:33 +02:00
Tim Cussins
7ac3056da9
sockets.c: Add missing lwip_select_dec_sockets_used within lwip_select.
...
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-04-18 20:50:33 +02:00
goldsimon
0952e618bd
netconn_drain(): use lwip_netconn_is_err_msg() on acceptmbox, too.
2017-04-18 10:54:40 +02:00
Axel Lin
0b2a652317
api_msg: Use lwip_netconn_is_err_msg instead of NULL test in netconn_drain()
...
The NULL test no longer work after commit e0a2472706
, it needs to test with
lwip_netconn_is_err_msg() instead.
Fixes: e0a2472706
("netconn/sockets: remove fatal error handling, fix asynchronous error handling, ensure data before RST can be received")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-04-18 10:47:42 +02:00
Joel Cunningham
f28c1c851b
loopif: set pbuf if_idx during poll
...
This sets the pbuf's if_idx during the loopif poll function (the
equivalent netif input function). This was found during IP_PKTINFO
development where p->if_idx is read and was uninitialized
2017-04-15 11:31:38 -05:00
goldsimon
1e02f9e88b
add mqtt_test.c to test/unit/Filelists.mk
2017-04-12 22:05:53 +02:00
goldsimon
5cc168c0f1
added unit test for mqtt (that does not really do something useful yet)
2017-04-12 21:54:42 +02:00
goldsimon
bf01941b23
opt.h: provide LWIP_NUM_SYS_TIMEOUT_INTERNAL as default value for MEMP_NUM_SYS_TIMEOUT that can be extended by local lwipopts.h
2017-04-12 21:52:34 +02:00
goldsimon
dfc57f0289
mqtt: move struct mqtt_client_s and inner structs to new file mqtt_priv.h (to hide it from apps but provide it for tests)
2017-04-12 21:50:58 +02:00
goldsimon
5310d8f13c
event_callback: separated ++ from if
2017-04-12 12:40:50 +02:00
goldsimon
e0a2472706
netconn/sockets: remove fatal error handling, fix asynchronous error handling, ensure data before RST can be received
2017-04-12 12:37:16 +02:00
goldsimon
064044eeae
sockets: speed up event_callback: don't iterate select_cb_list for NETCONN_EVT_RCVPLUS/SENDPLUS if the socket has been readable/writable before already
2017-04-12 09:12:55 +02:00
goldsimon
58c21eb13c
sockets: speed up event_callback: don't iterate select_cb_list for NETCONN_EVT_RCVMINUS/SENDMINUS
2017-04-11 20:59:00 +02:00
goldsimon
b6fdb61654
sockets.c: refactor event_callback() a bit
2017-04-11 20:55:47 +02:00
goldsimon
b0af09ec45
select_cb_ctr no needed any more for LWIP_TCPIP_CORE_LOCKING==1
2017-04-11 12:50:25 +02:00
goldsimon
7b477b32b8
let unit test sys_arch check that a mutex is not taken recursively
2017-04-11 12:43:33 +02:00
goldsimon
92997756d1
task #14420 (Remove sys_sem_signal from inside SYS_ARCH_PROTECT crit section) done for LWIP_TCPIP_CORE_LOCKING==1
2017-04-11 12:40:44 +02:00
goldsimon
26d3466f50
Add macro ETH_ADDR() to initialize a struct eth_addr with its 6 bytes and taking care of correct braces
2017-04-11 08:49:15 +02:00
Dirk Ziegelmeier
8695e6e6cb
Fixup BRIDGEIF_INITDATA2 macro
2017-04-07 08:59:26 +02:00
Dirk Ziegelmeier
7ba5cc3d52
Improve bridgeif doxygen docs
2017-04-07 08:01:38 +02:00
Joel Cunningham
557a11047d
Patch #9307 : Replace mem_malloc+memset with mem_calloc
...
Aside from reducing source code, on systems which use MEM_LIBC_MALLOC,
this has the potential to improve performance depending on the underlying
memory allocator
See http://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc
2017-04-05 14:53:24 -05:00
goldsimon
b34f2d5605
altcp: allocate altcp_pcbs from a pool, not from heap (new option MEMP_NUM_ALTCP_PCB defaults to MEMP_NUM_TCP_PCB)
2017-04-05 12:18:48 +02:00
Dirk Ziegelmeier
0f4ad57033
Fix build error in bridgeif.c
2017-04-05 08:11:37 +02:00
goldsimon
9c78909857
bridgeif: sanity-check init_data->max_ports <= BRIDGEIF_MAX_PORTS
2017-04-04 22:12:38 +02:00
goldsimon
77df9ccd5a
bridgeif: fix that max_fdb_static_entries was used to init dynamic FDB
2017-04-04 22:09:31 +02:00
goldsimon
2a30fedbea
fix passing NULL to netif_set_gw & netif_set_netmask (or netif_set_addr or netif_add) (broken on 18.03.2017 by 2d9ef2215b
)
2017-04-04 22:08:37 +02:00
goldsimon
97f4033a8a
bridgeif: improve documentation
2017-04-04 21:54:52 +02:00
goldsimon
8ed2bd4771
bridgeif: gracefully handle out-of-memory in bridgeif_fdb_init
2017-04-04 21:54:30 +02:00
goldsimon
e65a0950b2
mem_calloc: check for mem_size_t overflow when multiplying 2 mem_size_t input values
2017-04-04 21:52:01 +02:00
Joel Cunningham
6fe66771cb
test_tcp: de-duplicate test IP addresses, netmask, and ports
...
This creates a single version of test IP addresses, netmasks, and ports.
All tests were using the same values, but duplicated in each test
This also adds const to some functions so we can use a const version
of addresses
2017-03-31 12:01:43 -05:00
Joel Cunningham
648b2b6f2b
test_tcp: remove unnecessary memsets
...
test_tcp_init_netif() memsets both netif and txcounters, so no need to manually do it
2017-03-31 11:59:12 -05:00