/*
net_packet.c -- Handles in- and outgoing VPN packets
Copyright (C) 1998-2005 Ivo Timmermans,
- 2000-2010 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2011 Guus Sliepen <guus@tinc-vpn.org>
2010 Timothy Redaelli <timothy@redaelli.eu>
2010 Brandon Black <blblack@gmail.com>
#include "ethernet.h"
#include "event.h"
#include "graph.h"
-#include "list.h"
#include "logger.h"
#include "net.h"
#include "netutl.h"
receive_packet(n, inpkt);
}
-void receive_tcppacket(connection_t *c, char *buffer, int len) {
+void receive_tcppacket(connection_t *c, const char *buffer, int len) {
vpn_packet_t outpkt;
outpkt.len = len;
"No valid key known yet for %s (%s), forwarding via TCP",
n->name, n->hostname);
- if(n->last_req_key + 10 < now) {
+ if(n->last_req_key + 10 <= now) {
send_req_key(n);
n->last_req_key = now;
}
for(node = edge_weight_tree->head; node; node = node->next) {
e = node->data;
+ if(e->to == myself)
+ continue;
+
if(sockaddrcmp_noport(from, &e->address)) {
if(last_hard_try == now)
continue;