]> git.meshlink.io Git - meshlink/commitdiff
Fix memcpy when filling packet data
authorSaverio Proto <zioproto@gmail.com>
Thu, 10 Apr 2014 11:10:22 +0000 (13:10 +0200)
committerSaverio Proto <zioproto@gmail.com>
Thu, 10 Apr 2014 11:10:22 +0000 (13:10 +0200)
src/libmeshlink.c

index f84642dfc9c11ff7a77fdf4ae8e2fa4da44b765e..ca03b791f6d4c1b9069b12c530e8faa06abdb01d 100644 (file)
@@ -565,8 +565,8 @@ bool tinc_send_packet(node_t *receiver, const char* buf, unsigned int len) {
 
        packet.priority = 0;
 
-       memcpy(packet.data,hdr,sizeof(hdr));
-       memcpy(packet.data+sizeof(hdr),buf,len);
+       memcpy(packet.data,hdr,32);
+       memcpy(packet.data+32,buf,len);
 
         myself->in_packets++;
         myself->in_bytes += packet.len;