netd: fix gethostbyname: only add answsers that are inet addrs.
authorBrett Gordon <beretta42@gmail.com>
Sun, 27 Nov 2016 14:46:32 +0000 (09:46 -0500)
committerBrett Gordon <beretta42@gmail.com>
Sun, 27 Nov 2016 14:46:32 +0000 (09:46 -0500)
Applications/netd/gethostbyname.c

index 3f1135a..aa5a662 100644 (file)
@@ -234,12 +234,11 @@ struct hostent *gethostbyname( char *name ){
            if( t->type == 0x01 ){
                for( j=0; j<t->rdlen; j++ )
                    addrs[lno][j] = *ptr++;
+               list[lno++] = &addrs[lno][0];
            }
            else{
                ptr += t->rdlen;
            }
-           list[lno] = &addrs[lno][0];
-           lno++;
        }
        list[lno] = NULL;
     }