projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
de78d79
)
Restore length of the original packet in send_udppacket().
author
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 26 Apr 2006 16:29:47 +0000
(16:29 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 26 Apr 2006 16:29:47 +0000
(16:29 +0000)
src/net_packet.c
patch
|
blob
|
history
diff --git
a/src/net_packet.c
b/src/net_packet.c
index 31e18b470fd552f1c53f3dd51586f0feb82c15a9..8b877c21a93e59349695fac2aef00542b3db1522 100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-285,10
+285,11
@@
void receive_tcppacket(connection_t *c, char *buffer, int len)
receive_packet(c->node, &outpkt);
}
receive_packet(c->node, &outpkt);
}
-static void send_udppacket(node_t *n, vpn_packet_t *
in
pkt)
+static void send_udppacket(node_t *n, vpn_packet_t *
orig
pkt)
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
+ vpn_packet_t *inpkt = origpkt;
int nextpkt = 0;
vpn_packet_t *outpkt;
int origlen;
int nextpkt = 0;
vpn_packet_t *outpkt;
int origlen;
@@
-404,7
+405,7
@@
static void send_udppacket(node_t *n, vpn_packet_t *inpkt)
}
end:
}
end:
-
in
pkt->len = origlen;
+
orig
pkt->len = origlen;
}
/*
}
/*
@@
-457,11
+458,8
@@
void broadcast_packet(const node_t *from, vpn_packet_t *packet)
ifdebug(TRAFFIC) logger(LOG_INFO, _("Broadcasting packet of %d bytes from %s (%s)"),
packet->len, from->name, from->hostname);
ifdebug(TRAFFIC) logger(LOG_INFO, _("Broadcasting packet of %d bytes from %s (%s)"),
packet->len, from->name, from->hostname);
- if(from != myself) {
- if(overwrite_mac)
- memcpy(packet->data, mymac.x, ETH_ALEN);
- write_packet(packet);
- }
+ if(from != myself)
+ send_packet(myself, packet);
for(node = connection_tree->head; node; node = node->next) {
c = node->data;
for(node = connection_tree->head; node; node = node->next) {
c = node->data;