/*
device.c -- Interaction with Linux ethertap and tun/tap device
Copyright (C) 2001-2005 Ivo Timmermans,
- 2001-2012 Guus Sliepen <guus@tinc-vpn.org>
+ 2001-2013 Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "conf.h"
#include "device.h"
#include "logger.h"
+#include "names.h"
#include "net.h"
#include "route.h"
#include "utils.h"
static bool read_packet(vpn_packet_t *packet) {
int inlen;
-
+
switch(device_type) {
case DEVICE_TYPE_TUN:
inlen = read(device_fd, packet->data + 10, MTU - 10);
return false;
}
+ memset(packet->data, 0, 12);
packet->len = inlen + 10;
break;
case DEVICE_TYPE_TAP: