2025-07-29 1:54 AM - last edited on 2025-08-01 7:21 AM by Saket_Om
Hi all,
I've noticed that a DHCP client can not get an IP address from the server if both mDNS server and DHCP client are enabled.
The reason seems to be in ST Ethernet driver (nx_stm32_eth_driver.c):
static UINT _nx_driver_hardware_initialize(NX_IP_DRIVER *driver_req_ptr)
{
...
FilterConfig.BroadcastFilter = ENABLE;
...
}
static UINT _nx_driver_hardware_multicast_join(NX_IP_DRIVER *driver_req_ptr)
{
/* Increase the multicast count. */
nx_driver_information.nx_driver_information_multicast_count++;
/* Enable multicast frame reception. */
FilterConfig.PassAllMulticast = ENABLE;
HAL_ETH_SetMACFilterConfig(ð_handle, &FilterConfig);
/* Return success. */
return(NX_SUCCESS);
}
In _nx_driver_hardware_initialize() FilterConfig is just prepared, there is no HAL_ETH_SetMACFilterConfig() call.
That's why DHCP works OK if mDNS is not used.
If mDNS is active, it calls _nx_driver_hardware_multicast_join() and applies a prepared FilterConfig where BroadcastFilter is ENABLED.
This blocks DHCP work.
Fix seems to be: set BroadcastFilter to DISABLE in _nx_driver_hardware_initialize()
Is such a fix correct?
2025-08-11 8:14 AM - edited 2025-08-12 2:24 AM
Hello @sssooo, and welcome to ST Community!
Could you please provide a minimal version of the project that reproduces this issue? This will help us analyze the problem more efficiently. Thank you!
Best regards,
2025-08-18 6:49 AM
Hello,
please see attached project for NUCLEO-H563ZI.
If you will try the project as is, DHCP and mDNS works ok.
This is because I've manually set BroadcastFilter to DISABLE in _nx_driver_hardware_initialize().
You can try to change it to ENABLE and DHCP will not work (it will not receive a broadcast packet from DHCP server).
Please notice that nx_mdns_create() and nx_mdns_enable() are called before nx_dhcp_start().
This is done intentionally for fast DHCP fail demonstration (with BroadcastFilter = ENABLE).
If mDNS starts after DHCP at first look all works ok together, but after a few hours DHCP will try to extend IP lease time but without success because of BroadcastFilter activated by mDNS.
Regards