"'Sockaddr_in uneclared (first use in this function)" error despite including necessary headers
#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <unistd.h> #include <arpa/inet.h> #include <netdb.h> #include <unistd.h> #include <signal.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <errno.h> #include <sys/time.h> #include <stdlib.h> #include <memory.h> #include <ifaddrs.h>#include <net/if.h> #include <stdarg.h> #define BACKLOG 10 void * get_in_addr(struct sockaddr *sa){ if(sa->sa_family == AF_INET){ return &((sockaddr_in *)sa)->sin_addr; } else if(sa->sa_family == AF_INET6){ return &((sockaddr_in6 *)sa)->sin6_addr; } } I use the sockaddr_in structure in my code for chekc, whether the incoming connection is an IPv4 or an IPV6 address. I get the error message "sockaddr_in undeclared (first use in this function)", despite the inclusion of the netinet / in.h header in my code. Is there something I don't see here?