]> git.meshlink.io Git - meshlink/blobdiff - src/net_packet.c
Handle SPTPS datagrams in try_mac().
[meshlink] / src / net_packet.c
index 4e651555e4ccb88f8c8a56f00850ce88d25eaaec..a744485fd5aebd90f1454c21be7c63bfd1d6e745 100644 (file)
@@ -252,6 +252,9 @@ static void receive_packet(node_t *n, vpn_packet_t *packet) {
 }
 
 static bool try_mac(node_t *n, const vpn_packet_t *inpkt) {
+       if(experimental && OPTION_VERSION(n->options) >= 2)
+               return sptps_verify_datagram(&n->sptps, (char *)inpkt->data - 4, inpkt->len);
+
        if(!digest_active(&n->indigest) || inpkt->len < sizeof inpkt->seqno + digest_length(&n->indigest))
                return false;