projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Count the number of correctly received UDP packets.
[tinc]
/
src
/
net_packet.c
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
81ca70a
..
c0be8c4
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-365,6
+365,8
@@
static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
if(inpkt->seqno > n->received_seqno)
n->received_seqno = inpkt->seqno;
if(inpkt->seqno > n->received_seqno)
n->received_seqno = inpkt->seqno;
+ n->received++;
+
if(n->received_seqno > MAX_SEQNO)
regenerate_key();
if(n->received_seqno > MAX_SEQNO)
regenerate_key();
@@
-739,11
+741,11
@@
bool receive_sptps_record(void *handle, uint8_t type, const char *data, uint16_t
int offset = (type & PKT_MAC) ? 0 : 14;
if(type & PKT_COMPRESSED) {
int offset = (type & PKT_MAC) ? 0 : 14;
if(type & PKT_COMPRESSED) {
- len = uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression);
- if(len < 0) {
+ len
gth_t ulen
= uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression);
+ if(
u
len < 0) {
return false;
} else {
return false;
} else {
- inpkt.len = len + offset;
+ inpkt.len =
u
len + offset;
}
if(inpkt.len > MAXSIZE)
abort();
}
if(inpkt.len > MAXSIZE)
abort();