summaryrefslogtreecommitdiff
path: root/common/src/nx_tcp_socket_packet_process.c
diff options
context:
space:
mode:
authorYuxin Zhou <[email protected]>2021-07-28 07:24:24 +0000
committerYuxin Zhou <[email protected]>2021-07-28 07:24:24 +0000
commitcb2245c8d1041d8250df797dd145091d08cd194c (patch)
tree939ad587587d3169c5b3360610a95798e979fbf8 /common/src/nx_tcp_socket_packet_process.c
parentc187d60014b149ee7c5e79b4d84c416caddbdef7 (diff)
Release 6.1.8v6.1.8_rel
Diffstat (limited to 'common/src/nx_tcp_socket_packet_process.c')
-rw-r--r--common/src/nx_tcp_socket_packet_process.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/common/src/nx_tcp_socket_packet_process.c b/common/src/nx_tcp_socket_packet_process.c
index 085d8b47..878ff945 100644
--- a/common/src/nx_tcp_socket_packet_process.c
+++ b/common/src/nx_tcp_socket_packet_process.c
@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _nx_tcp_socket_packet_process PORTABLE C */
-/* 6.1 */
+/* 6.1.8 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@@ -83,6 +83,9 @@
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
+/* 08-02-2021 Yuxin Zhou Modified comment(s), and */
+/* supported TCP/IP offload, */
+/* resulting in version 6.1.8 */
/* */
/**************************************************************************/
VOID _nx_tcp_socket_packet_process(NX_TCP_SOCKET *socket_ptr, NX_PACKET *packet_ptr)
@@ -98,6 +101,12 @@ ULONG rx_sequence;
ULONG rx_window;
UINT outside_of_window;
ULONG mss = 0;
+#ifdef NX_ENABLE_TCPIP_OFFLOAD
+ULONG tcpip_offload;
+
+ tcpip_offload = socket_ptr -> nx_tcp_socket_connect_interface -> nx_interface_capability_flag &
+ NX_INTERFACE_CAPABILITY_TCPIP_OFFLOAD;
+#endif /* NX_ENABLE_TCPIP_OFFLOAD */
/* Add debug information. */
NX_PACKET_DEBUG(__FILE__, __LINE__, packet_ptr);
@@ -112,7 +121,11 @@ ULONG mss = 0;
header_length = (tcp_header_copy.nx_tcp_header_word_3 >> NX_TCP_HEADER_SHIFT) * (ULONG)sizeof(ULONG);
/* Process the segment if socket state is equal or greater than NX_TCP_SYN_RECEIVED. According to RFC 793, Section 3.9, Page 69. */
- if (socket_ptr -> nx_tcp_socket_state >= NX_TCP_SYN_RECEIVED)
+ if ((socket_ptr -> nx_tcp_socket_state >= NX_TCP_SYN_RECEIVED)
+#ifdef NX_ENABLE_TCPIP_OFFLOAD
+ && (!tcpip_offload)
+#endif /* NX_ENABLE_TCPIP_OFFLOAD */
+ )
{
/* Step1: Check sequence number. According to RFC 793, Section 3.9, Page 69. */
@@ -366,12 +379,18 @@ ULONG mss = 0;
/* Check for data in the current packet. */
packet_queued = _nx_tcp_socket_state_data_check(socket_ptr, packet_ptr);
- /* Call the ESTABLISHED state handling function to process any state
- changes caused by this new packet. */
- _nx_tcp_socket_state_established(socket_ptr);
+#ifdef NX_ENABLE_TCPIP_OFFLOAD
+ if (!tcpip_offload)
+#endif /* NX_ENABLE_TCPIP_OFFLOAD */
+ {
- /* Determine if any transmit suspension can be lifted. */
- _nx_tcp_socket_state_transmit_check(socket_ptr);
+ /* Call the ESTABLISHED state handling function to process any state
+ changes caused by this new packet. */
+ _nx_tcp_socket_state_established(socket_ptr);
+
+ /* Determine if any transmit suspension can be lifted. */
+ _nx_tcp_socket_state_transmit_check(socket_ptr);
+ }
/* State processing is complete. */
break;