I have a network address eg - 192.168.74.0/24. Trying to get the network address translation using getaddrinfo, doesnt seem to work. name here is 192.168.74.0/24. return value from getaddrindo is -2. Works well for ipv4 address without prefix.
static const struct addrinfo hint = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_NUMERICHOST
};
struct addrinfo *ai;
int ret;
ret = getaddrinfo(name, NULL, &hint, &ai);
if (ret) {
printf("cannot parse '%s'", name);
return false;
}