]> git.meshlink.io Git - meshlink/commitdiff
Dealing with legacy MTU probingwq
authorSaverio Proto <zioproto@gmail.com>
Sat, 12 Apr 2014 19:04:51 +0000 (21:04 +0200)
committerSaverio Proto <zioproto@gmail.com>
Sat, 12 Apr 2014 19:04:51 +0000 (21:04 +0200)
src/libmeshlink.c
src/libmeshlink.h

index 00eaa09cd1e6cedd2e06326dbe712e8480ab4509..34ac088099ec54c19f56cba487e88f6be139a6a4 100644 (file)
@@ -571,14 +571,15 @@ bool tinc_send_packet(node_t *receiver, const char* buf, unsigned int len) {
        return false;
        }
 
+       memset(hdr->legacymtu,0,sizeof(hdr->legacymtu));
        memcpy(hdr->destination,receiver->name,sizeof(hdr->destination));
        memcpy(hdr->source,myself->name,sizeof(hdr->source));
 
        packet.priority = 0;
        packet.len = sizeof(tincpackethdr) + len;
 
-       memcpy(packet.data,hdr,32);
-       memcpy(packet.data+32,buf,len);
+       memcpy(packet.data,hdr,32+14);
+       memcpy(packet.data+32+14,buf,len);
 
         myself->in_packets++;
         myself->in_bytes += packet.len;
index 4c7c4a95a5d81afd4957e92b64a0d62b400b29d6..f2fbd5c4b64966ade273f8aa848b7fce0b3bbdff 100644 (file)
@@ -41,6 +41,7 @@ bool tinc_start(const char* path);
 bool tinc_stop();
 
 typedef struct tincpackethdr {
+  u_int8_t legacymtu[14];
   u_int8_t destination[16];
   u_int8_t source[16];
 } __attribute__ ((__packed__)) tincpackethdr;