netdev
[Top] [All Lists]

inet_ntop...

To: netdev@xxxxxxxxxxx
Subject: inet_ntop...
From: Armando Aguirre Schlick <aaguirre@xxxxxxxx>
Date: Fri, 14 Jul 2000 12:40:28 -0400 (CST)
Sender: owner-netdev@xxxxxxxxxxx
   Hi, I have some trouble...
   When i want to use inet_ntop i have a dump...
   The arg is "in", an "struct in6_addr *".
   And i test it in this way:
        
        for (uint i=0; i<4; i++)
        printf("Direccion original %x.\n",in->s6_addr32[i]);
        
   The output is:
        Direccion original 0.
        Direccion original 0.
        Direccion original 0.
        Direccion original 1000000.
        
   This one is "::1", but when i execute the next line i have a 
 "segmentation fault" error...

     printf("%d.- %s (direccion almacenada).\n",i+1,
             inet_ntop(AF_INET6, in, hbuf2,
             INET6_ADDRSTRLEN));
             
    I defined hbuf2 as "char *" and "i" is ok.
    
    What's wrong??
    Thanks.

<Prev in Thread] Current Thread [Next in Thread>