Release 6.1.4

This commit is contained in:
Yuxin Zhou 2021-02-02 05:29:56 +00:00
parent fd45d4cbd1
commit 854ec313cb
50 changed files with 438 additions and 304 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2018,7 +2018,7 @@ UINT pid_index;
/* FUNCTION RELEASE */
/* */
/* _nx_pop3_parse_response PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -2064,6 +2064,9 @@ UINT pid_index;
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), improved */
/* buffer length verification, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
void _nx_pop3_parse_response(CHAR *buffer, UINT argument_index, UINT buffer_length, CHAR *argument, UINT argument_length,
@ -2132,7 +2135,7 @@ UINT argument_char_count;
}
/* Are we at the end of the buffer? */
if (i == buffer_length)
if ((i == buffer_length) && (buffer_length >= 2))
{
/* Yes, is there a line terminator? */

View File

@ -2787,7 +2787,7 @@ NX_PPPOE_CLIENT_SESSION *client_session_ptr = NX_NULL;
/* FUNCTION RELEASE */
/* */
/* _nx_pppoe_server_discovery_send PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -2831,6 +2831,9 @@ NX_PPPOE_CLIENT_SESSION *client_session_ptr = NX_NULL;
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), */
/* fixed the compiler errors, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
static UINT _nx_pppoe_server_discovery_send(NX_PPPOE_SERVER *pppoe_server_ptr, NX_PPPOE_CLIENT_SESSION *client_session_ptr, UINT code)
@ -2916,7 +2919,7 @@ UCHAR *service_name_ptr;
{
/* Get the service name. */
if (_nx_utility_string_length_check((const char *)(service_name_ptr), &tag_length, NX_MAX_STRING_LENGTH))
if (_nx_utility_string_length_check((char *)(service_name_ptr), &tag_length, NX_MAX_STRING_LENGTH))
{
nx_packet_release(packet_ptr);
return(NX_PPPOE_SERVER_SERVICE_NAME_ERROR);
@ -3054,7 +3057,7 @@ UCHAR *service_name_ptr;
{
/* Calculate the Generic-Error string length. */
if (_nx_utility_string_length_check((const char *)(client_session_ptr -> nx_pppoe_generic_error), &tag_length, NX_MAX_STRING_LENGTH))
if (_nx_utility_string_length_check((char *)(client_session_ptr -> nx_pppoe_generic_error), &tag_length, NX_MAX_STRING_LENGTH))
{
nx_packet_release(packet_ptr);
return(NX_SIZE_ERROR);
@ -3178,7 +3181,7 @@ NX_IP_DRIVER driver_request;
/* FUNCTION RELEASE */
/* */
/* _nx_pppoe_server_tag_process PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -3217,6 +3220,10 @@ NX_IP_DRIVER driver_request;
/* packet length verification, */
/* verified memcpy use cases, */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), improved */
/* string length verification, */
/* fixed the compiler errors, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
static UINT _nx_pppoe_server_tag_process(NX_PPPOE_SERVER *pppoe_server_ptr, NX_PPPOE_CLIENT_SESSION *client_session_ptr, UINT code, UCHAR *tag_ptr, ULONG length)
@ -3228,9 +3235,9 @@ UINT tag_index = 0;
UINT tag_service_name_count = 0;
UINT tag_service_name_valid = NX_FALSE;
UINT service_name_index = 0;
UINT service_name_length;
#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE
UCHAR *service_name_ptr;
UINT service_name_length;
#endif
/* Initialize the value. */
@ -3300,11 +3307,21 @@ UINT service_name_length;
while (service_name_index < pppoe_server_ptr -> nx_pppoe_service_name_count)
{
/* Get the length of service name. */
if (_nx_utility_string_length_check((char *)(pppoe_server_ptr -> nx_pppoe_service_name[service_name_index]),
&service_name_length, tag_length))
{
service_name_index++;
continue;
}
/* Compare the same service name with PPPoE Service Name. */
if (!memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_service_name[service_name_index]), tag_length))
if ((service_name_length == tag_length) &&
(!memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_service_name[service_name_index]), tag_length)))
{
tag_service_name_valid = NX_TRUE;
client_session_ptr -> nx_pppoe_service_name = pppoe_server_ptr -> nx_pppoe_service_name[service_name_index];
client_session_ptr -> nx_pppoe_service_name_length = service_name_length;
break;
}
service_name_index ++;
@ -3334,7 +3351,7 @@ UINT service_name_length;
{
/* Get the service name. */
if (_nx_utility_string_length_check((const char *)(service_name_ptr), &service_name_length, NX_MAX_STRING_LENGTH))
if (_nx_utility_string_length_check((char *)(service_name_ptr), &service_name_length, NX_MAX_STRING_LENGTH))
{
return(NX_PPPOE_SERVER_SERVICE_NAME_ERROR);
}
@ -3344,7 +3361,7 @@ UINT service_name_length;
{
tag_service_name_valid = NX_TRUE;
}
else if ((tag_length != 0) && (service_name_length != 0))
else if ((tag_length != 0) && (tag_length == service_name_length))
{
/* Compare the service name. */
@ -3380,8 +3397,17 @@ UINT service_name_length;
while (service_name_index < pppoe_server_ptr -> nx_pppoe_service_name_count)
{
/* Get the length of service name. */
if (_nx_utility_string_length_check((char *)(pppoe_server_ptr -> nx_pppoe_service_name[service_name_index]),
&service_name_length, tag_length))
{
service_name_index++;
continue;
}
/* Find the same service name. */
if (!memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_service_name[service_name_index]), tag_length))
if ((service_name_length == tag_length) &&
(!memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_service_name[service_name_index]), tag_length)))
{
/* Update the information. */
@ -3400,7 +3426,8 @@ UINT service_name_length;
if (pppoe_server_ptr -> nx_pppoe_ac_name)
{
/* Check the access concentrator name. */
if (memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_ac_name), tag_length))
if ((pppoe_server_ptr -> nx_pppoe_ac_name_length != tag_length) ||
(memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_ac_name), tag_length)))
{
return(NX_PPPOE_SERVER_AC_NAME_ERROR);
@ -3409,7 +3436,8 @@ UINT service_name_length;
else
{
/* If user does not separately set Access Concentrator name, will use PPPoE server name as Access Concentrator name.*/
if (memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_name), tag_length))
if ((pppoe_server_ptr -> nx_pppoe_name_length != tag_length) ||
(memcmp(tag_ptr + tag_index, (pppoe_server_ptr -> nx_pppoe_name), tag_length)))
{
return(NX_PPPOE_SERVER_AC_NAME_ERROR);
@ -3957,7 +3985,7 @@ NX_PACKET *current_packet;
/* FUNCTION RELEASE */
/* */
/* PppInitInd PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -3978,7 +4006,7 @@ NX_PACKET *current_packet;
/* */
/* CALLS */
/* */
/* nx_pppoe_server_service_name_set Set the service name */
/* _nx_pppoe_server_service_name_set Set the service name */
/* */
/* CALLED BY */
/* */
@ -3991,6 +4019,9 @@ NX_PACKET *current_packet;
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), */
/* fixed the compiler errors, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
VOID PppInitInd(UINT length, UCHAR *aData)
@ -4006,7 +4037,7 @@ VOID PppInitInd(UINT length, UCHAR *aData)
{
/* Clean the default service name. */
nx_pppoe_server_service_name_set(_nx_pppoe_server_created_ptr, NX_NULL, 0);
_nx_pppoe_server_service_name_set(_nx_pppoe_server_created_ptr, NX_NULL, 0);
}
else
{
@ -4015,7 +4046,7 @@ VOID PppInitInd(UINT length, UCHAR *aData)
nx_pppoe_service_name[0] = aData;
/* Set the default service name. */
nx_pppoe_server_service_name_set(_nx_pppoe_server_created_ptr, nx_pppoe_service_name, 1);
_nx_pppoe_server_service_name_set(_nx_pppoe_server_created_ptr, nx_pppoe_service_name, 1);
}
}
@ -4212,7 +4243,7 @@ NX_PPPOE_CLIENT_SESSION *client_session_ptr;
/* FUNCTION RELEASE */
/* */
/* PppCloseInd PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -4232,7 +4263,7 @@ NX_PPPOE_CLIENT_SESSION *client_session_ptr;
/* */
/* CALLS */
/* */
/* nx_pppoe_server_session_terminate Terminate the PPPoE Session */
/* _nx_pppoe_server_session_terminate Terminate the PPPoE Session */
/* */
/* CALLED BY */
/* */
@ -4245,6 +4276,9 @@ NX_PPPOE_CLIENT_SESSION *client_session_ptr;
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), */
/* fixed the compiler errors, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
VOID PppCloseInd(UINT interfaceHandle, UCHAR *causeCode)
@ -4275,7 +4309,7 @@ VOID PppCloseInd(UINT interfaceHandle, UCHAR *causeCode)
_nx_pppoe_server_created_ptr -> nx_pppoe_client_session[interfaceHandle].nx_pppoe_generic_error = causeCode;
/* Send PADT to terminate the session. */
nx_pppoe_server_session_terminate(_nx_pppoe_server_created_ptr, interfaceHandle);
_nx_pppoe_server_session_terminate(_nx_pppoe_server_created_ptr, interfaceHandle);
/* Release the IP internal mutex. */
tx_mutex_put(&(_nx_pppoe_server_created_ptr -> nx_pppoe_ip_ptr -> nx_ip_protection));
@ -4351,7 +4385,7 @@ VOID PppCloseCnf(UINT interfaceHandle)
/* FUNCTION RELEASE */
/* */
/* PppTransmitDataCnf PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -4385,6 +4419,9 @@ VOID PppCloseCnf(UINT interfaceHandle)
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), */
/* fixed the compiler errors, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
VOID PppTransmitDataCnf(UINT interfaceHandle, UCHAR *data_ptr, UINT packet_id)
@ -4392,6 +4429,8 @@ VOID PppTransmitDataCnf(UINT interfaceHandle, UCHAR *data_ptr, UINT packet_id)
NX_PACKET *packet_ptr;
NX_PARAMETER_NOT_USED(data_ptr);
/* Check to see if PPPoE instance is created. */
if ((_nx_pppoe_server_created_ptr == NX_NULL) ||
(_nx_pppoe_server_created_ptr -> nx_pppoe_id != NX_PPPOE_SERVER_ID))
@ -4432,7 +4471,7 @@ NX_PACKET *packet_ptr;
/* FUNCTION RELEASE */
/* */
/* PppReceiveDataInd PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -4451,7 +4490,7 @@ NX_PACKET *packet_ptr;
/* */
/* CALLS */
/* */
/* nx_pppoe_server_session_send Send PPPoE session data */
/* _nx_pppoe_server_session_send Send PPPoE session data */
/* */
/* CALLED BY */
/* */
@ -4464,6 +4503,9 @@ NX_PACKET *packet_ptr;
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), */
/* fixed the compiler errors, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
VOID PppReceiveDataInd(UINT interfaceHandle, UINT data_length, UCHAR *data_ptr)
@ -4488,6 +4530,6 @@ VOID PppReceiveDataInd(UINT interfaceHandle, UINT data_length, UCHAR *data_ptr)
return;
/* Send data. */
nx_pppoe_server_session_send(_nx_pppoe_server_created_ptr, interfaceHandle, data_ptr, data_length);
_nx_pppoe_server_session_send(_nx_pppoe_server_created_ptr, interfaceHandle, data_ptr, data_length);
}
#endif

View File

@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* nx_pppoe_server.h PORTABLE C */
/* 6.1 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -44,6 +44,9 @@
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), */
/* fixed the compiler errors, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
@ -315,16 +318,6 @@ UINT nx_pppoe_server_session_terminate(NX_PPPOE_SERVER *pppoe_server_ptr, UIN
UINT nx_pppoe_server_session_get(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, ULONG *client_mac_msw, ULONG *client_mac_lsw, ULONG *session_id);
VOID _nx_pppoe_server_packet_deferred_receive(NX_PACKET *packet_ptr);
#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE
VOID PppInitInd(UINT length, UCHAR *aData);
VOID PppDiscoverCnf(UINT length, UCHAR *aData, UINT interfaceHandle);
VOID PppOpenCnf(UCHAR accept, UINT interfaceHandle);
VOID PppCloseInd(UINT interfaceHandle, UCHAR *causeCode);
VOID PppCloseCnf(UINT interfaceHandle);
VOID PppTransmitDataCnf(UINT interfaceHandle, UCHAR *aData, UINT packet_id);
VOID PppReceiveDataInd(UINT interfaceHandle, UINT length, UCHAR *aData);
#endif
#else
UINT _nxe_pppoe_server_create(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR *name, NX_IP *ip_ptr, UINT interface_index,
@ -369,6 +362,16 @@ VOID _nx_pppoe_server_packet_deferred_receive(NX_PACKET *packet_ptr);
#endif /* NX_PPPOE_SERVER_SOURCE_CODE */
#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE
VOID PppInitInd(UINT length, UCHAR *aData);
VOID PppDiscoverCnf(UINT length, UCHAR *aData, UINT interfaceHandle);
VOID PppOpenCnf(UCHAR accept, UINT interfaceHandle);
VOID PppCloseInd(UINT interfaceHandle, UCHAR *causeCode);
VOID PppCloseCnf(UINT interfaceHandle);
VOID PppTransmitDataCnf(UINT interfaceHandle, UCHAR *aData, UINT packet_id);
VOID PppReceiveDataInd(UINT interfaceHandle, UINT length, UCHAR *aData);
#endif
/* Determine if a C++ compiler is being used. If so, complete the standard
C conditional started above. */
#ifdef __cplusplus

View File

@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* nx_api.h PORTABLE C */
/* 6.1.3 */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Yuxin Zhou, Microsoft Corporation */
@ -57,6 +57,9 @@
/* string to unsigned integer, */
/* updated product constants, */
/* resulting in version 6.1.3 */
/* 02-02-2021 Yuxin Zhou Modified comment(s), and */
/* updated product constants, */
/* resulting in version 6.1.4 */
/* */
/**************************************************************************/
@ -365,7 +368,7 @@ VOID _nx_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, ULONG
#define AZURE_RTOS_NETX
#define NETX_MAJOR_VERSION 6
#define NETX_MINOR_VERSION 1
#define NETX_PATCH_VERSION 3
#define NETX_PATCH_VERSION 4
/* The following symbols are defined for backward compatibility reasons.*/
#define EL_PRODUCT_NETX

View File

@ -371,6 +371,8 @@ void ppp_server_packet_send(NX_PACKET *packet_ptr)
UINT interfaceHandle = 0;
#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE
NX_PACKET *temp_packet = packet_ptr;
while(packet_ptr)
{
@ -380,6 +382,8 @@ UINT interfaceHandle = 0;
/* Move to the next packet structure. */
packet_ptr = packet_ptr -> nx_packet_next;
}
nx_packet_transmit_release(temp_packet);
#else
/* Directly Call PPPoE send function to send out the data through PPPoE module. */
nx_pppoe_server_session_packet_send(&pppoe_server, interfaceHandle, packet_ptr);