[Bug] RT-AX86S Merlin 3004.388.10: WireGuard check_wgc_endpoint() may block on _wg_resolv_ep() getaddrinfo()
Firmware: RT-AX86S, Merlin 3004.388.10
Issue: WireGuard endpoint check can block indefinitely
Description:
In the function check_wgc_endpoint() (WG client), the internal call to _wg_resolv_ep() may block indefinitely on getaddrinfo() if DNS resolution is slow or fails.
Symptoms observed:
- Process STAT = S
- wchan = __skb_recv_datagram
- Other /proc debugging unavailable
- Multiple blocked processes may accumulate, slightly increasing memory usage
Code snippet:
static int _wg_resolv_ep(const char* ep_addr, char* buf, size_t len)
{
struct addrinfo hints, *servinfo, *p;
...
ret = getaddrinfo(ep_addr, NULL , &hints , &servinfo);
...
}
Suggested considerations:
- Add a timeout to getaddrinfo() call (currently blocking indefinitely)
- Consider async DNS resolution or separate thread/process
- Minimal fix: alarm()/SIGALRM or socket-level timeout