Bug 187526 - [patch] traceroute(8): traceroute -a breaks of "whois" socket timeout
Summary: [patch] traceroute(8): traceroute -a breaks of "whois" socket timeout
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 8.4-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Eugene Grosbein
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2014-03-13 11:00 UTC by Eugene Grosbein
Modified: 2022-10-17 12:37 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (2.45 KB, patch)
2014-03-13 11:00 UTC, Eugene Grosbein
no flags Details | Diff
traceroute.diff (3.66 KB, patch)
2014-03-31 17:53 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein 2014-03-13 11:00:00 UTC
	"traceroute -a" opens TCP socket to whois server and fails to check
	if this socket stays valid during (sometimes long) runtime.
	If whois server closes this connection, traceroute gets EOF at next
	hop (and shows AS0) and is killed with SIGPIPE later.

Fix: A workaround is to lower wait time for proble timeout using '-w 1' option.

	The following patch fixes the problem introducing proper error checking
	while reading/writing "whois" connection. In case of error it reconnects.
How-To-Repeat: 
$ traceroute -Ia 194.150.149.239
traceroute to 194.150.149.239 (194.150.149.239), 64 hops max, 72 byte packets
 1  [AS29072] 62.231.161.217 (62.231.161.217)  0.276 ms  0.268 ms  0.189 ms
 2  [AS29072] k-45.rdtc.ru (62.231.160.42)  1.169 ms  0.496 ms  0.706 ms
 3  [AS29072] asbr.rdtc.ru (62.231.191.137)  0.467 ms  0.548 ms  0.498 ms
 4  [AS31133] 37.29.3.49 (37.29.3.49)  1.423 ms  1.650 ms  1.374 ms
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  [AS0] 37.29.107.202 (37.29.107.202)  70.641 ms  70.599 ms  70.525 ms

	Here traceroute is killed. Instead, it should show complete trace:

11  [AS31133] 37.29.107.202 (37.29.107.202)  104.550 ms  70.603 ms  72.888 ms
12  [AS12389] 95.167.91.93 (95.167.91.93)  166.594 ms  65.702 ms  65.790 ms
13  [AS12389] customer-as41440.xe-0-2-0.brnl-rgr3.sib.ip.rostelecom.ru (188.254.36.146)  68.412 ms  68.322 ms  68.287 ms
14  [AS41440] ge-0-0-0-v501.bar-csr1.ncc.sibirtelecom.ru (213.228.118.6)  85.369 ms  101.501 ms  85.300 ms
15  [AS12846] 212.94.98.54 (212.94.98.54)  85.021 ms  85.116 ms  85.004 ms
16  [AS12846] Bsk-ATS24-c7301.mss.ab.ru (212.94.101.129)  74.240 ms  74.504 ms  74.214 ms
17  [AS12846] adsl-149-239.biysk.ru (194.150.149.239)  103.236 ms  103.358 ms  103.013 ms
Comment 1 Eugene Grosbein 2014-03-31 17:53:22 UTC
Here comes corrected version of patch that fixes traceroute6 too
(and unbreaks world building).
Comment 2 Eugene Grosbein freebsd_committer freebsd_triage 2017-09-19 17:46:57 UTC
My PR.
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:37:12 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>