diff --git a/src/platform/linux/misc.cpp b/src/platform/linux/misc.cpp index 81c08ed4..9da87337 100644 --- a/src/platform/linux/misc.cpp +++ b/src/platform/linux/misc.cpp @@ -424,7 +424,7 @@ namespace platf { // UDP GSO on Linux currently only supports sending 64K or 64 segments at a time size_t seg_index = 0; const size_t seg_max = 65536 / 1500; - struct iovec iovs[(send_info.headers ? std::min(seg_max, send_info.block_count) : 1) * max_iovs_per_msg] = {}; + struct iovec iovs[(send_info.headers ? std::min(seg_max, send_info.block_count) : 1) * max_iovs_per_msg]; auto msg_size = send_info.header_size + send_info.payload_size; while (seg_index < send_info.block_count) { int iovlen = 0; @@ -507,10 +507,11 @@ namespace platf { { // If GSO is not supported, use sendmmsg() instead. - struct mmsghdr msgs[send_info.block_count] = {}; - struct iovec iovs[send_info.block_count * (send_info.headers ? 2 : 1)] = {}; + struct mmsghdr msgs[send_info.block_count]; + struct iovec iovs[send_info.block_count * (send_info.headers ? 2 : 1)]; int iov_idx = 0; for (size_t i = 0; i < send_info.block_count; i++) { + msgs[i].msg_len = 0; msgs[i].msg_hdr.msg_iov = &iovs[iov_idx]; msgs[i].msg_hdr.msg_iovlen = send_info.headers ? 2 : 1; @@ -528,6 +529,7 @@ namespace platf { msgs[i].msg_hdr.msg_namelen = msg.msg_namelen; msgs[i].msg_hdr.msg_control = cmbuf.buf; msgs[i].msg_hdr.msg_controllen = cmbuflen; + msgs[i].msg_hdr.msg_flags = 0; } // Call sendmmsg() until all messages are sent @@ -620,7 +622,7 @@ namespace platf { memcpy(CMSG_DATA(pktinfo_cm), &pktInfo, sizeof(pktInfo)); } - struct iovec iovs[2] = {}; + struct iovec iovs[2]; int iovlen = 0; if (send_info.header) { iovs[iovlen].iov_base = (void *) send_info.header;