[OpenWrt-Devel] getaddrinfo breaks with IPV6 and IPV4

Baptiste Clenet bapclenet at gmail.com
Thu Aug 6 05:52:27 EDT 2015


I try to use getaddrinfo() function and I send as parameters:

  static char addrstr[256] = "::1";
  struct addrinfo *res, *ainfo;
  struct addrinfo hints;
  memset ((char *)&hints, 0, sizeof(hints));
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_family = AF_UNSPEC;

  int error = getaddrinfo(addrstr, "", &hints, &res);

  if (error != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(error));
    return error;

And it gives me:
getaddrinfo: Unrecognized service

I tried with an IPV4 address, same problem. Do you know which
implementation of getaddrinfo OpenWRT use?


openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list