From 9be7cd7be00381870a235bf0acb97bce0e8b742f Mon Sep 17 00:00:00 2001 From: kris Date: Tue, 24 Aug 2010 23:22:01 +0000 Subject: [PATCH] Use host.times.timeout instead of a hardcoded read timeout in path-mtu.nse. I forgot to update this since I posted path-mtu before the host.times{} stuff. --- scripts/path-mtu.nse | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/path-mtu.nse b/scripts/path-mtu.nse index 2f875314d..8d8612eed 100644 --- a/scripts/path-mtu.nse +++ b/scripts/path-mtu.nse @@ -308,7 +308,13 @@ action = function(host) pcap:pcap_open(host.interface, 104, 0, callback, "dst host " .. saddr .. " and (icmp or (" .. proto .. " and src host " .. daddr .. " and src port " .. port .. "))") - pcap:set_timeout(3000) + -- Since we're sending potentially large amounts of data per packet, + -- simply bump up the host's calculated timeout value. Most replies + -- should come from routers along the path, fragmentation reassembly + -- times isn't an issue and the large amount of data is only travelling + -- in one direction; still, we want a response from the target so call + -- it 1.5*timeout to play it safer. + pcap:set_timeout(1.5 * host.times.timeout * 1000) m = searchmtu(1, host.interface_mtu)