X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;h=6f72e05b3380d4102c19521dbd178d36b02d2375;hb=bdd84660c756437cf3bc8f64adf612055acc84ea;hp=69835eef5faa9bf4f92a3d1c91143d9743e3f80f;hpb=eca357ed916c9782a64a68a2f30b144d84027795;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 69835eef..6f72e05b 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -458,7 +458,7 @@ bool receive_tcppacket_sptps(connection_t *c, const char *data, int len) { /* This can happen in the form of a race condition if the node just became unreachable. */ logger(DEBUG_TRAFFIC, LOG_WARNING, "Cannot relay TCP packet from %s (%s) because the destination, %s (%s), is unreachable", from->name, from->hostname, to->name, to->hostname); - return; + return true; } /* Help the sender reach us over UDP. @@ -1252,8 +1252,12 @@ void send_packet(node_t *n, vpn_packet_t *packet) { // If it's for myself, write it to the tun/tap device. if(n == myself) { - if(overwrite_mac) + if(overwrite_mac) { memcpy(DATA(packet), mymac.x, ETH_ALEN); + // Use an arbitrary fake source address. + memcpy(DATA(packet) + ETH_ALEN, DATA(packet), ETH_ALEN); + DATA(packet)[ETH_ALEN * 2 - 1] ^= 0xFF; + } n->out_packets++; n->out_bytes += packet->len; devops.write(packet);