equal
deleted
inserted
replaced
27 if ((hs = gethostbyname (ip)) == NULL) { |
27 if ((hs = gethostbyname (ip)) == NULL) { |
28 perror ("[-] Error"); |
28 perror ("[-] Error"); |
29 return -1; |
29 return -1; |
30 } |
30 } |
31 sock.sin_family = hs->h_addrtype; |
31 sock.sin_family = hs->h_addrtype; |
32 memcpy (&sock.sin_addr.s_addr, hs->h_addr, hs->h_length); |
32 memcpy (&sock.sin_addr.s_addr, hs->h_addr_list[0], hs->h_length); |
33 } |
33 } |
34 |
34 |
35 if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { |
35 if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { |
36 perror ("[-] Error"); |
36 perror ("[-] Error"); |
37 return -1; |
37 return -1; |