vpn_packet_t packet;
tincpackethdr* hdr = malloc(sizeof(tincpackethdr));
- if (14 + sizeof(hdr) + len > MAXSIZE) {
+ if (sizeof(hdr) + len > MAXSIZE) {
//log something
return false;
packet.priority = 0;
packet.len = sizeof(tincpackethdr) + len;
- memset(packet.data,1,14);
- memcpy(packet.data+14,hdr,32);
- memcpy(packet.data+32+14,buf,len);
+ memcpy(packet.data,hdr,32);
+ memcpy(packet.data+32,buf,len);
myself->in_packets++;
myself->in_bytes += packet.len;