/*
net_packet.c -- Handles in- and outgoing VPN packets
Copyright (C) 1998-2005 Ivo Timmermans,
- 2000-2016 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2017 Guus Sliepen <guus@tinc-vpn.org>
2010 Timothy Redaelli <timothy@redaelli.eu>
2010 Brandon Black <blblack@gmail.com>
vpn_packet_t inpkt;
inpkt.offset = DEFAULT_PACKET_OFFSET;
+ inpkt.priority = 0;
if(type == PKT_PROBE) {
if(!from->status.udppacket) {
vpn_packet_t packet;
packet.offset = DEFAULT_PACKET_OFFSET;
packet.priority = 0;
+ static int errors = 0;
if(devops.read(&packet)) {
+ errors = 0;
myself->in_packets++;
myself->in_bytes += packet.len;
route(myself, &packet);
+ } else {
+ usleep(errors * 50000);
+ errors++;
+ if(errors > 10) {
+ logger(DEBUG_ALWAYS, LOG_ERR, "Too many errors from %s, exiting!", device);
+ event_exit();
+ }
}
}