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
66998cffa0
commit
e1191841cc
@ -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