Skip to content

Commit

Permalink
Fix a rather miserable screwup which made cjdns never perform a search
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdelisle committed Mar 30, 2017
1 parent 2f7986c commit 1b0c999
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dht/Pathfinder.c
Expand Up @@ -281,11 +281,11 @@ static Iface_DEFUN switchErr(struct Message* msg, struct Pathfinder_pvt* pf)

static Iface_DEFUN searchReq(struct Message* msg, struct Pathfinder_pvt* pf)
{
uint32_t version = Message_pop32(msg, NULL);
Message_pop32(msg, NULL);
if (version && version >= 20) { return NULL; }
uint8_t addr[16];
Message_pop(msg, addr, 16, NULL);
Message_pop32(msg, NULL);
uint32_t version = Message_pop32(msg, NULL);
if (version && version >= 20) { return NULL; }
Assert_true(!msg->length);
uint8_t printedAddr[40];
AddrTools_printIp(printedAddr, addr);
Expand Down
8 changes: 4 additions & 4 deletions subnode/SubnodePathfinder.c
Expand Up @@ -159,16 +159,16 @@ static void getRouteReply(Dict* msg, struct Address* src, struct MsgCore_Promise

//NodeCache_discoverNode(pf->nc, &al->elems[0]);
struct Message* msgToCore = Message_new(0, 512, prom->alloc);
Iface_CALL(sendNode, msgToCore, &al->elems[0], 0xfff00000, PFChan_Pathfinder_NODE, pf);
Iface_CALL(sendNode, msgToCore, &al->elems[0], 0xfff00033, PFChan_Pathfinder_NODE, pf);
}

static Iface_DEFUN searchReq(struct Message* msg, struct SubnodePathfinder_pvt* pf)
{
uint32_t version = Message_pop32(msg, NULL);
Message_pop32(msg, NULL);
if (version && version < 20) { return NULL; }
uint8_t addr[16];
Message_pop(msg, addr, 16, NULL);
Message_pop32(msg, NULL);
uint32_t version = Message_pop32(msg, NULL);
if (version && version < 20) { return NULL; }
Assert_true(!msg->length);
uint8_t printedAddr[40];
AddrTools_printIp(printedAddr, addr);
Expand Down
4 changes: 2 additions & 2 deletions tools/sessionStats
Expand Up @@ -26,11 +26,11 @@ var printSession = function (session) {
if (process.argv.indexOf('--ip6') !== -1) {
addr = addr.replace(/[a-z0-9]{52}.k/, PublicToIp6.convert);
}
var out = [ addr, ' ', state, ' ', session.handle, ' ', session.sendHandle ];
var out = [ addr, state, session.handle, session.sendHandle, Number(session.metric).toString(16) ];
if (Number(session.duplicates) !== 0) { out.push(' DUP ', session.duplicates); }
if (Number(session.lostPackets) !== 0) { out.push(' LOS ', session.lostPackets); }
if (Number(session.receivedOutOfRange) !== 0) { out.push(' OOR ', session.receivedOutOfRange); }
console.log(out.join(''));
console.log(out.join(' '));
};

var cjdns;
Expand Down

0 comments on commit 1b0c999

Please sign in to comment.