Merge remote-tracking branch 'remotes/guus/1.1' into thkr-1.1-ponyhof

This commit is contained in:
thorkill 2015-11-07 23:21:18 +01:00
commit dcf313cdbf
3 changed files with 24 additions and 25 deletions

View file

@ -1255,8 +1255,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);