We are currently using Oat++ (https://oatpp.io/) as a webserver for an embedded project. It is working wonder with several environments: docker container, ubuntu VM, Raspberry Pi 3.
However, for this project we have our own linux distribution built with Yocto (https://www.yoctoproject.org/) and after some debugging, we realize that the getaddrinfo
(http://man7.org/linux/man-pages/man3/getaddrinfo.3.html) function is not working.
Here's a sample code of what is happening:
struct addrinfo *result = NULL;
struct addrinfo hints;
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = AI_PASSIVE;
int iResult = getaddrinfo(NULL, "8080", &hints, &result);
// iResult == EAI_ADDRFAMILY
Has anyone any idea of what could be the problem?
PS: We tried comparing the kernel config with the one from the Raspberry Pi 3 but without success PSS: We also tried to set the IP (i.e.: getaddrinfo("192.168.1.10", "8080", &hints, &result)), also without success