Closed yumitsu closed 5 years ago
Good day. I found that traceroute tool contains two bugs. The first one sometimes appears when you're trying to traceroute a host that in 1 HOP from you:
./traceroute exit.li exit.li has ip address fcbd:5668:fe09:43a:d838:181:6b51:ba5e v19.0000.0000.0000.0001.*.k *:* 1ms v19.0000.0000.0000.08e3.9jkygq92fxg3bpm7bp466gfvzg2vff5gb68uxpkg386yq8rdd5b0.k d838:0181 76ms 62ms 60ms 59ms 89ms 63ms 62ms 62ms 61ms 61ms 62ms 61ms 104ms 79ms 61ms ^C
Looks like it happens because of loop in tracePath function. The second one appears on reverse trace due to timeout:
tracePath
./traceroute h.cjdns.ca h.cjdns.ca has ip address fcf4:e309:14b5:5498:cafd:4f59:4b9c:7f84 v19.0000.0000.0000.0001.*.k *:* 1ms v19.0000.0000.0020.2263.2v6dt6f841hzhq2wsqwt263w2dswkt6fz82vcyxqptk88mtp8y50.k cafd:4f59 158ms success, trying reverse trace v19.0000.0000.0020.2263.2v6dt6f841hzhq2wsqwt263w2dswkt6fz82vcyxqptk88mtp8y50.k 158ms v20.0000.0000.0320.2263.cmnkylz1dx8mx3bdxku80yw20gqmg0s9nsrusdv0psnxnfhqfmu0.k f1ad:12eb 279ms v20.0000.0000.3320.2263.4x6hj8bk81nt6udk8h3wzsc01bl2unlytbvjj4b6vnhjzz7b8nw0.k ac89:bab9 3002ms /Users/yumitsu/Work/opensource/cjdns/tools/traceroute:110 if (ret.nodes.length === 0) { ^ TypeError: Cannot read property 'length' of undefined at /Users/yumitsu/Work/opensource/cjdns/tools/traceroute:110:26 at /Users/yumitsu/Work/opensource/cjdns/tools/traceroute:49:13 at Object.callback (/Users/yumitsu/Work/opensource/cjdns/tools/lib/Semaphore.js:7:30) at Socket.<anonymous> (/Users/yumitsu/Work/opensource/cjdns/tools/lib/cjdnsadmin/cjdnsadmin.js:191:17) at emitTwo (events.js:106:13) at Socket.emit (events.js:194:7) at UDP.onMessage [as onmessage] (dgram.js:545:8)
That happens because cjdns.RouterModule_nextHop function returns object without nodes entry when stumbled upon timeout:
cjdns.RouterModule_nextHop
nodes
{ error: 'none', ms: '3000', result: 'timeout', txid: '3646868479', from: 'v20.0000.0000.3320.2263.*.k', fromIP6: '*' }
I made a fix and will commit it soon.
Good day. I found that traceroute tool contains two bugs. The first one sometimes appears when you're trying to traceroute a host that in 1 HOP from you:
Looks like it happens because of loop in
tracePath
function. The second one appears on reverse trace due to timeout:That happens because
cjdns.RouterModule_nextHop
function returns object withoutnodes
entry when stumbled upon timeout:I made a fix and will commit it soon.