projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure the packet source MAC address is always set.
[tinc]
/
src
/
net_packet.c
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
fc5720a
..
6f72e05
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-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 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);
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);
n->out_packets++;
n->out_bytes += packet->len;
devops.write(packet);