This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Help me


Hello ML
I have the program for scan ports, in the which there is :

        sin.sin_family=AF_INET;
        sin.sin_port=htons(110);
        sin.sin_addr.s_addr=htonl(counter);
        addr.s_addr=htonl(counter);
        bzero(&(sin.sin_zero), 8);
        
        if (connect(sock, (struct sockaddr*)&sin, sizeof(sin))==0)
          {
           read(sock, buffer, sizeof(buffer));
          if (strstr(buffer, "QPOP") != NULL)
            {
               fprintf(stdout, "FOUND : %s\n", inet_ntoa(addr));
            }
          }

With gcc -g -oprova prova.c   is ok!
No error.
When run the program (prova) in the gdb, subsequently line
 if (connect(sock, (struct sockaddr*)&sin, sizeof(sin))==0)
write the command print connect.
The result is :
$1 = {< text variable, no debug info >} 0x400c9ca0 <__libc_connect>
Why ?
The result of connect no egual -1 (error connecting) or 0 (connecting ok) ?

Help me
Thanks
Ciao by italy

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]