]> www.tinc-vpn.org Git - tinc/blobdiff - src/linux/device.c
Fix compiler warnings.
[tinc] / src / linux / device.c
index cbf215298dd635e8ff1d2cb869c6d93d114e4862..5ae89478c44254e36ca25c05e147259ad108c6db 100644 (file)
@@ -210,7 +210,7 @@ static bool write_packet(vpn_packet_t *packet) {
                        }
                        break;
                case DEVICE_TYPE_ETHERTAP:
-                       *(short int *)(packet->data - 2) = packet->len;
+                       memcpy(packet->data - 2, &packet->len, 2);
 
                        if(write(device_fd, packet->data - 2, packet->len + 2) < 0) {
                                logger(LOG_ERR, "Can't write to %s %s: %s", device_info, device,