X-Git-Url: https://git.librecmc.org/?p=oweals%2Ftinc.git;a=blobdiff_plain;f=src%2Fbsd%2Fdevice.c;h=419c38fb9851b5396d70f5b2e804a48ec306e906;hp=8649d89fe5b02467aac982276628d564bd8cd7a7;hb=5214ece03009a916159c710cf436af1e92909f41;hpb=40f02ff8eee359dc0ccc898f8da319f56af161ad diff --git a/src/bsd/device.c b/src/bsd/device.c index 8649d89..419c38f 100644 --- a/src/bsd/device.c +++ b/src/bsd/device.c @@ -245,7 +245,7 @@ bool write_packet(vpn_packet_t *packet) case DEVICE_TYPE_TUNIFHEAD: { u_int32_t type; - struct iovec vector[2] = {{&type, sizeof(type)}, {packet->data + 14, MTU - 14}}; + struct iovec vector[2] = {{&type, sizeof(type)}, {packet->data + 14, packet->len - 14}}; int af; af = (packet->data[12] << 8) + packet->data[13];