Do IPv6 as well -- should be alright in idnlookup as it is.
[icmp-dn.git] / idnlookup.c
index be4809b..2c49f87 100644 (file)
@@ -164,7 +164,6 @@ int main(int argc, char **argv)
     }
     
     memset(&aihint, 0, sizeof(aihint));
-    aihint.ai_family = PF_INET; /* Only IPv4 for now. */
     aihint.ai_socktype = SOCK_RAW;
     aihint.ai_protocol = IPPROTO_ICMP;
     ret = getaddrinfo(argv[optind], NULL, &aihint, &ai);
@@ -196,7 +195,7 @@ int main(int argc, char **argv)
            pfd.events = POLLIN;
            gettimeofday(&tvc, NULL);
            elapsed = ((tvc.tv_sec - tvb.tv_sec) * 1000) + ((tvc.tv_usec - tvb.tv_usec) / 1000);
-           if(elapsed > timeout) {
+           if(elapsed >= timeout) {
                fprintf(stderr, "idnlookup: timeout\n");
                exit(1);
            }