X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsptps.c;h=fe978441a912b62249a4f7192b1fecd189afe3a2;hb=cc3c69c892b0dad9a6ece0a0f4ccd429a22fcbff;hp=386b6fd2a1bedb7917d76bae113e5dddf463de20;hpb=dd07c9fc1f37bed8d1f67ffe7b203f61e7914edf;p=tinc diff --git a/src/sptps.c b/src/sptps.c index 386b6fd2..fe978441 100644 --- a/src/sptps.c +++ b/src/sptps.c @@ -1,6 +1,6 @@ /* sptps.c -- Simple Peer-to-Peer Security - Copyright (C) 2011-2012 Guus Sliepen , + Copyright (C) 2011-2013 Guus Sliepen , 2010 Brandon L. Black This program is free software; you can redistribute it and/or modify @@ -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);