summaryrefslogtreecommitdiffstats
path: root/usr.sbin/traceroute/worker.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2017-01-13 18:00:10 +0000
committerflorian <florian@openbsd.org>2017-01-13 18:00:10 +0000
commitfd4cc5ed91940167708c4e4d7f9080c417bb567a (patch)
tree78f0657809a2a99aecc87d8dd844fdd741844f7a /usr.sbin/traceroute/worker.c
parentsync (diff)
downloadwireguard-openbsd-fd4cc5ed91940167708c4e4d7f9080c417bb567a.tar.xz
wireguard-openbsd-fd4cc5ed91940167708c4e4d7f9080c417bb567a.zip
traceroute never sees a timeout when poll(2) returns when it receives
a packet not intended for us. E.g. a ping(8) is running in parallel. In this case we need to account for the time we already waited. Pointed out by Gabriel Nieto <gabnietof AT gmail>, thanks! Looks good to and input millert@
Diffstat (limited to 'usr.sbin/traceroute/worker.c')
-rw-r--r--usr.sbin/traceroute/worker.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/traceroute/worker.c b/usr.sbin/traceroute/worker.c
index d27e82abd52..ac13644eb5d 100644
--- a/usr.sbin/traceroute/worker.c
+++ b/usr.sbin/traceroute/worker.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: worker.c,v 1.1 2016/09/03 22:00:06 benno Exp $ */
+/* $OpenBSD: worker.c,v 1.2 2017/01/13 18:00:10 florian Exp $ */
/* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */
/*
@@ -227,7 +227,7 @@ wait_for_reply(int sock, struct msghdr *mhdr)
pfd[0].events = POLLIN;
pfd[0].revents = 0;
- if (poll(pfd, 1, waittime * 1000) > 0)
+ if (poll(pfd, 1, curwaittime) > 0)
cc = recvmsg(rcvsock, mhdr, 0);
return (cc);