Bug in AZRTOS netx-duo-dhcpv6-client function nx_dhcpv6_client_create()
In AZRTOS - NetXDuo ver 6.4, netx-duo-dhcpv6-client library,
if NX_DISABLE_ERROR_CHECKING is not defined (i.e. calling first _nxe_dhcpv6_client_create()),
function nx_dhcpv6_client_create() should check for valid input parameters and return errors according to error type.
From manual:
"
nx_dhcpv6_client_create
Create a DHCPv6 client instance
Prototype
UINT nx_dhcpv6_client_create( NX_DHCPV6 *dhcpv6_ptr, NX_IP *ip_ptr, CHAR *name_ptr, NX_PACKET_POOL *packet_pool_ptr, VOID *stack_ptr, ULONG stack_size, VOID (*dhcpv6_state_change_notify)( struct NX_DHCPV6_STRUCT *dhcpv6_ptr, UINT old_state, UINT new_state), VOID (*dhcpv6_server_error_handler)( struct NX_DHCPV6_STRUCT *dhcpv6_ptr, UINT op_code, UINT status_code, UINT message_type));
Description
This service creates a DHCPv6 client instance including callback functions.
Input Parameters
dhcpv6_ptr: Pointer to DHCPv6 control block
ip_ptr: Pointer to Client IP instance
name_ptr: Pointer to name for DHCPv6 instance
packet_pool_ptr: Pointer to Client packet pool
stack_ptr: Pointer to Client stack memory
stack_size: Size of Client stack memory
dhcpv6_state_change_notify: Pointer to callback function invoked when the Client initiates a new DHCPv6 request to the server
dhcpv6_server_error_handler: Pointer to callback function invoked when the Client receives an error status from the server
Return Values
NX_SUCCESS (0x00) Successful Client create
NX_PTR_ERROR (0x16) Invalid pointer input
NX_DHCPV6_PARAM_ERROR (0xE93) Invalid non pointer input
"
Actually if parameter
packet_pool_ptr: Pointer to Client packet pool
does not point to a packet pool ( as when the variable has been defined but not initialized ), the functions does not returns NX_DHCPV6_PARAM_ERROR (0xE93) Invalid non pointer input but NX_SUCCESS (0x00) Successful Client create.
As for every discrepancy between reference manual and actual code, could be that manual is inaccurate, but in this case it is mandatory to edit ASAP with correct wording.
