Use inet_pton() instead of inet_aton()