projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code beautification, start of multicast support.
[tinc]
/
src
/
net_packet.c
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
d64b6bf
..
af34d05
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_packet.c,v 1.1.2.4
3 2003/10/11 12:16:12
guus Exp $
+ $Id: net_packet.c,v 1.1.2.4
4 2003/12/12 19:52:25
guus Exp $
*/
#include "system.h"
*/
#include "system.h"
@@
-104,7
+104,7
@@
static void receive_packet(node_t *n, vpn_packet_t *packet)
ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Received packet of %d bytes from %s (%s)"),
packet->len, n->name, n->hostname);
ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Received packet of %d bytes from %s (%s)"),
packet->len, n->name, n->hostname);
- route
_incoming
(n, packet);
+ route(n, packet);
}
static void receive_udppacket(node_t *n, vpn_packet_t *inpkt)
}
static void receive_udppacket(node_t *n, vpn_packet_t *inpkt)
@@
-242,8
+242,7
@@
static void send_udppacket(node_t *n, vpn_packet_t *inpkt)
/* Since packet is on the stack of handle_tap_input(), we have to make a copy of it first. */
/* Since packet is on the stack of handle_tap_input(), we have to make a copy of it first. */
- copy = xmalloc(sizeof(vpn_packet_t));
- memcpy(copy, inpkt, sizeof(vpn_packet_t));
+ *(copy = xmalloc(sizeof(*copy))) = *inpkt;
list_insert_tail(n->queue, copy);
list_insert_tail(n->queue, copy);
@@
-344,14
+343,14
@@
void send_packet(const node_t *n, vpn_packet_t *packet)
cp();
cp();
- ifdebug(TRAFFIC) logger(LOG_ERR, _("Sending packet of %d bytes to %s (%s)"),
- packet->len, n->name, n->hostname);
-
if(n == myself) {
if(n == myself) {
-
ifdebug(TRAFFIC) logger(LOG_NOTICE, _("Packet is looping back to us!")
);
+
write_packet(packet
);
return;
}
return;
}
+ ifdebug(TRAFFIC) logger(LOG_ERR, _("Sending packet of %d bytes to %s (%s)"),
+ packet->len, n->name, n->hostname);
+
if(!n->status.reachable) {
ifdebug(TRAFFIC) logger(LOG_INFO, _("Node %s (%s) is not reachable"),
n->name, n->hostname);
if(!n->status.reachable) {
ifdebug(TRAFFIC) logger(LOG_INFO, _("Node %s (%s) is not reachable"),
n->name, n->hostname);