Do need to flush DHCP Server Context clientBinding[] after netInterface link is down?
|
void netProcessLinkChange(NetInterface *interface) |
My config:
#define DHCP_SERVER_MAX_CLIENTS 3 // may be 1? )
RNDIS Driver
After 3 connections (USB plug unplug), the host does not receive the IP address! No free clientBinding[].
Now my decision:
add in void rndisDriverEventHandler(NetInterface *interface)
...
else {
//Link is down
interface->linkState = FALSE;
//Clean DHCP clientBinding
for(uint16_t i = 0; i< DHCP_SERVER_MAX_CLIENTS; i++){
memset(&interface->dhcpServerContext->clientBinding[i], 0 , sizeof(DhcpServerBinding));
}
...
May be use callback:error_t netAttachLinkChangeCallback(NetInterface *interface, NetLinkChangeCallback callback, void *param) ?
Best Regards,
Aleksandr (aka bullitmaster)!
Do need to flush DHCP Server Context clientBinding[] after netInterface link is down?
CycloneTCP/core/net_misc.c
Line 191 in 697d4f6
My config:
#define DHCP_SERVER_MAX_CLIENTS 3 // may be 1? )RNDIS Driver
After 3 connections (USB plug unplug), the host does not receive the IP address! No free clientBinding[].
Now my decision:
add in
void rndisDriverEventHandler(NetInterface *interface)May be use callback:
error_t netAttachLinkChangeCallback(NetInterface *interface, NetLinkChangeCallback callback, void *param)?Best Regards,
Aleksandr (aka bullitmaster)!