cjdns/cjdns.tools.patch
Stuart D. Gathman 9b2cd28a9f Release 20.3-1
2019-05-08 12:27:11 -04:00

30 lines
1.2 KiB
Diff

diff -up ./tools/traceroute.tools ./tools/traceroute
--- ./tools/traceroute.tools 2019-05-02 04:02:32.000000000 -0400
+++ ./tools/traceroute 2019-05-08 12:18:10.958661859 -0400
@@ -83,6 +83,11 @@ var main = function (target) {
cjdns.RouterModule_getPeers("0000.0000.0000.0001", waitFor(function (err, ret) {
if (err) { throw err; }
+ if (!ret.peers) {
+ console.error('missing CJDNS admin password');
+ cjdns.disconnect();
+ process.exit(0);
+ }
self = ret.peers[0];
}));
@@ -101,11 +106,12 @@ var main = function (target) {
}).nThen(function (waitFor) {
- if (!lastRet || lastRet.nodes[0] !== lastRet.from) { return; }
+ if (!lastRet || !lastRet.nodes || lastRet.nodes[0] !== lastRet.from) { return; }
console.log('success, trying reverse trace');
process.stdout.write(lastRet.from);
tracePath(nodeToIP6(self), lastRet.from, cjdns, function (ret) {
lastRet = ret;
+ if (!ret || !ret.nodes) { return; }
process.stdout.write(' ' + ret.ms + 'ms\n');
if (ret.result === 'timeout') {
process.stdout.write('\n' + ret.from + ' ' + ret.result + '!');