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.
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>
The NULL test no longer work after commit e0a2472706ee, it needs to test with
lwip_netconn_is_err_msg() instead.
Fixes: e0a2472706ee ("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>
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
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
This commit moves common defines and senqo array so they can be
re-used in mulptiple places for sequence number checking rather
than duplicated
Currently they are used in two places, but I'm anticipating needing
them in future TCP unit tests
This commit corrects what looks like an ancient incorrect organization
of the logic for processing an ACK which acks new data. Once moved,
we can also change to using TCP_SEQ_LEQ on ackno instead of TCP_BETWEEN
because ackno has already been checked against snd_nxt
The work of checking the unsent queue and updating pcb->snd_buf (both
steps required for new data ACK) should be located under the conditional
that checks TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)
The comment following the unsent queue check/pcb->snd_buf update even
indicates "End of ACK for new data processing" when the logic is clearly
outside of this check
From what I can tell, this mis-organization isn't causing any incorrect
behavior since the unsent queue checked that ackno was between start of
segment and snd_nxt and recv_acked would be 0 during pcb->snd_buf update.
Instead this is waisted work for duplicate ACKS (can be common) and other
old ACKs