It seems that a value of addr->ai_socktype returned by getaddrinfo inpg_stat.c is not SOCK_DGRAM.
Kenji Sugita