From 5e6a4e5f5e0022dccbc2f6cf8a8b38c038720866 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 6 Mar 2017 15:12:28 -0800 Subject: Send revocations automatically on deauth for instant kill, also fix some issues with the RP. --- node/Node.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'node/Node.cpp') diff --git a/node/Node.cpp b/node/Node.cpp index a75a56b4..1125ca7a 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -774,6 +774,24 @@ void Node::ncSendConfig(uint64_t nwid,uint64_t requestPacketId,const Address &de } } +void Node::ncSendRevocation(const Address &destination,const Revocation &rev) +{ + if (destination == RR->identity.address()) { + SharedPtr n(network(rev.networkId())); + if (!n) return; + n->addCredential(RR->identity.address(),rev); + } else { + Packet outp(destination,RR->identity.address(),Packet::VERB_NETWORK_CREDENTIALS); + outp.append((uint8_t)0x00); + outp.append((uint16_t)0); + outp.append((uint16_t)0); + outp.append((uint16_t)1); + rev.serialize(outp); + outp.append((uint16_t)0); + RR->sw->send(outp,true); + } +} + void Node::ncSendError(uint64_t nwid,uint64_t requestPacketId,const Address &destination,NetworkController::ErrorCode errorCode) { if (destination == RR->identity.address()) { -- cgit v1.2.3