Certain ICMP error replies cause ping to perform a reverse DNS
lookup on an IP address from the packet (such as the IP that sent a TTL exceeded error). If the DNS lookup takes a long time, ^C will appear to be ineffective since the SIGINT handler just sets a flag and returns. Work around this by exiting immediately on receipt of a second SIGINT when DNS lookups are enabled. PR: bin/4696 MFC after: 1 week
This commit is contained in:
parent
5bb0c94f9d
commit
c8bb99e577
@ -830,6 +830,12 @@ stopit(sig)
|
||||
int sig __unused;
|
||||
{
|
||||
|
||||
/*
|
||||
* When doing reverse DNS lookups, the finish_up flag might not
|
||||
* be noticed for a while. Just exit if we get a second SIGINT.
|
||||
*/
|
||||
if (!(options & F_NUMERIC) && finish_up)
|
||||
_exit(nreceived ? 0 : 2);
|
||||
finish_up = 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user