]> git.meshlink.io Git - meshlink/blobdiff - src/sptps.c
Count the number of correctly received UDP packets.
[meshlink] / src / sptps.c
index 386b6fd2a1bedb7917d76bae113e5dddf463de20..c22926a84184353ee59fbad823442074dc561a37 100644 (file)
@@ -486,6 +486,10 @@ static bool sptps_receive_data_datagram(sptps_t *s, const char *data, size_t len
        if(seqno > s->inseqno)
                s->inseqno = seqno + 1;
 
+       if(!s->inseqno)
+               s->received = 0;
+       else
+               s->received++;
 
        // Decrypt.
        cipher_set_counter(&s->incipher, &seqno, sizeof seqno);