Send a new key when we receive packets from a node we don't have a valid key for.
This commit is contained in:
parent
a9b80226e1
commit
bc87b45003
1 changed files with 10 additions and 2 deletions
|
@ -332,13 +332,21 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
|
||||||
size_t outlen;
|
size_t outlen;
|
||||||
|
|
||||||
if(n->status.sptps) {
|
if(n->status.sptps) {
|
||||||
|
if(!n->sptps.state) {
|
||||||
|
if(!n->status.waitingforkey) {
|
||||||
|
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but we haven't exchanged keys yet", n->name, n->hostname);
|
||||||
|
send_req_key(n);
|
||||||
|
} else {
|
||||||
|
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet", n->name, n->hostname);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
sptps_receive_data(&n->sptps, (char *)&inpkt->seqno, inpkt->len);
|
sptps_receive_data(&n->sptps, (char *)&inpkt->seqno, inpkt->len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!cipher_active(n->incipher)) {
|
if(!cipher_active(n->incipher)) {
|
||||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet",
|
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet", n->name, n->hostname);
|
||||||
n->name, n->hostname);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue