Fix combination of Mode = router and DeviceType = tap on Linux.
[oweals/tinc.git] / src / linux / device.c
index 5ae89478c44254e36ca25c05e147259ad108c6db..71fedef6fa0080b19fe5d5cd841f5ea5c12ce80a 100644 (file)
@@ -94,6 +94,8 @@ static bool setup_device(void) {
                device_type = DEVICE_TYPE_TUN;
                device_info = "Linux tun/tap device (tun mode)";
        } else {
+               if (routing_mode == RMODE_ROUTER)
+                       overwrite_mac = true;
                ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
                device_type = DEVICE_TYPE_TAP;
                device_info = "Linux tun/tap device (tap mode)";
@@ -155,6 +157,7 @@ static bool read_packet(vpn_packet_t *packet) {
                                return false;
                        }
 
+                       memset(packet->data, 0, 12);
                        packet->len = lenin + 10;
                        break;
                case DEVICE_TYPE_TAP: