From: Saverio Proto Date: Sat, 12 Apr 2014 19:04:51 +0000 (+0200) Subject: Dealing with legacy MTU probingwq X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=bde0d73919778e0c31f79a6c14efad7e9378b633;p=meshlink Dealing with legacy MTU probingwq --- diff --git a/src/libmeshlink.c b/src/libmeshlink.c index 00eaa09c..34ac0880 100644 --- a/src/libmeshlink.c +++ b/src/libmeshlink.c @@ -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; diff --git a/src/libmeshlink.h b/src/libmeshlink.h index 4c7c4a95..f2fbd5c4 100644 --- a/src/libmeshlink.h +++ b/src/libmeshlink.h @@ -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;