From: Etienne Dechamps Date: Mon, 30 Jun 2014 13:03:17 +0000 (+0100) Subject: Verify seqno early in sptps_verify_datagram(). X-Git-Tag: release-1.1pre11~64 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=ddd0cd47bc0bb3478b7d250192248a1e3aa2a243;hp=ddd0cd47bc0bb3478b7d250192248a1e3aa2a243;p=tinc Verify seqno early in sptps_verify_datagram(). This is a slight optimization for sptps_verify_datagram(), which might come in handy since this function is called in a loop via try_harder(). It turns out that since sptps_verify_datagram() doesn't update any state, it doesn't matter in which order verifications are done. However, it does affect performance since it's much cheaper to check the seqno than to try to decrypt the packet. Since this function is called with the wrong node most of the time, it makes verification vastly faster for the majority of calls because the seqno will be wrong in most cases. ---