Skip to main content
Graduate
January 27, 2025
Question

BUG AZRTOS NetXDuo v6.4 netx-duo-dhcpv6-client function nx_dhcpv6_request_solicit()

  • January 27, 2025
  • 2 replies
  • 1284 views

 

According to manual below, function should SEND out a SOLICIT message.

Function returns NX_SUCCESS (0x00) means SOLICIT message successfully sent.

 

Actually code, after some checks, just set nx_dhcpv6_state variable in DHCPv6 to NX_DHCPV6_STATE_SENDING_SOLICIT value and returns ALWAYS NX_SUCCESS, regardless of what DHCPv6 thread will do.

 

Therefore we will get NX_SUCCESS before actual sending the SOLICIT packet and even if this packet is not sent at all by DHCPv6 thread for any reason, e.g. no packets available in packet pool.

 

Also very critical, there is no high level function that user can use yo check for status end errors in DHCPv6 thread, no way to implement correctives actions unless to access global variables and void any quality certification.

 

nx_dhcpv6_request_solicit

Send a SOLICIT message

Prototype

UINT nx_dhcpv6_request_solicit(NX_DHCPV6 *dhcpv6_ptr);

Description

This service sends a SOLICIT message out on the network. If the message is successfully sent, a successful status is returned. A successful completion does not mean the Client received a response or has been granted an IPv6 address yet. The DHCPv6 Client thread task waits for a reply (an ADVERTISE message) from a DHCPv6 Server. If one is received, it checks the reply is valid, stores the data to the Client record and promotes the Client to the REQUEST state.

Note: If the Rapid Commit option is set, the DHCPv6 Client will go directly to the Bound state if it receives a valid Server ADVERTISE message. See the service description for nx_dhcpv6_request_solicit_rapid for more details.

Input Parameters

  • dhcpv6_ptr: Pointer to DHCPv6 Client instance

Return Values

  • NX_SUCCESS (0x00) SOLICIT message successfully sent

  • NX_PTR_ERROR (0x16) Invalid pointer input

  • NX_CALLER_ERROR (0x11) Must be called from thread

Allowed From

Threads

    This topic has been closed for replies.

    2 replies

    ST Employee
    January 27, 2025

    Hello @mbarg.1 ,

    what tests you did that confirm this statement :
    "Therefore, we will get NX_SUCCESS before actual sending the SOLICIT packet and even if this packet is not sent at all by DHCPv6 thread for any reason, e.g. no packets available in packet pool."
    did you see status return set to success without any request sent?
    also, I think that a correct calling flow will ensure that DHCP start is executed correctly before calling the solicit function.

    see the example netxduo/samples/demo_netxduo_dhcpv6_client.c at master · eclipse-threadx/netxduo · GitHub
    for more details.
    Regards

    mbarg.1Author
    Graduate
    January 27, 2025

    I can confirm that I discovered this bug because I did THIS mistake in my code:

    did not initialize packet pool.

    Now, DHCPv6_create() and DHCPv6_start executed with  nx_dhcpv6_request_solicit, as well as nx_dhcpv6_request_solicit(), but no packet were sent out from interface.

    To double check bug, I initialized correctly the packet pool, used all packets in the pool for other functions, than call nx_dhcpv6_request_solicit() and again I got nx_dhcpv6_request_solicit but no packet were sent out of interface and no error was reported anywhere.

    mbarg.1Author
    Graduate
    February 1, 2025

    AZRTOS is 3.3 - NetXDuo is 6.4 - STM32CubeIde is 1.17 - board I use as reference is NUCLEO-H743ZI/NUCLEO-H743ZI2 - H7 Fw 12.1.1