fix(build): remove VLA zeroing to fix Clang build (#4052)
This commit is contained in:
@@ -424,7 +424,7 @@ namespace platf {
|
|||||||
// UDP GSO on Linux currently only supports sending 64K or 64 segments at a time
|
// UDP GSO on Linux currently only supports sending 64K or 64 segments at a time
|
||||||
size_t seg_index = 0;
|
size_t seg_index = 0;
|
||||||
const size_t seg_max = 65536 / 1500;
|
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;
|
auto msg_size = send_info.header_size + send_info.payload_size;
|
||||||
while (seg_index < send_info.block_count) {
|
while (seg_index < send_info.block_count) {
|
||||||
int iovlen = 0;
|
int iovlen = 0;
|
||||||
@@ -507,10 +507,11 @@ namespace platf {
|
|||||||
|
|
||||||
{
|
{
|
||||||
// If GSO is not supported, use sendmmsg() instead.
|
// If GSO is not supported, use sendmmsg() instead.
|
||||||
struct mmsghdr msgs[send_info.block_count] = {};
|
struct mmsghdr msgs[send_info.block_count];
|
||||||
struct iovec iovs[send_info.block_count * (send_info.headers ? 2 : 1)] = {};
|
struct iovec iovs[send_info.block_count * (send_info.headers ? 2 : 1)];
|
||||||
int iov_idx = 0;
|
int iov_idx = 0;
|
||||||
for (size_t i = 0; i < send_info.block_count; i++) {
|
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_iov = &iovs[iov_idx];
|
||||||
msgs[i].msg_hdr.msg_iovlen = send_info.headers ? 2 : 1;
|
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_namelen = msg.msg_namelen;
|
||||||
msgs[i].msg_hdr.msg_control = cmbuf.buf;
|
msgs[i].msg_hdr.msg_control = cmbuf.buf;
|
||||||
msgs[i].msg_hdr.msg_controllen = cmbuflen;
|
msgs[i].msg_hdr.msg_controllen = cmbuflen;
|
||||||
|
msgs[i].msg_hdr.msg_flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call sendmmsg() until all messages are sent
|
// Call sendmmsg() until all messages are sent
|
||||||
@@ -620,7 +622,7 @@ namespace platf {
|
|||||||
memcpy(CMSG_DATA(pktinfo_cm), &pktInfo, sizeof(pktInfo));
|
memcpy(CMSG_DATA(pktinfo_cm), &pktInfo, sizeof(pktInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct iovec iovs[2] = {};
|
struct iovec iovs[2];
|
||||||
int iovlen = 0;
|
int iovlen = 0;
|
||||||
if (send_info.header) {
|
if (send_info.header) {
|
||||||
iovs[iovlen].iov_base = (void *) send_info.header;
|
iovs[iovlen].iov_base = (void *) send_info.header;
|
||||||
|
|||||||
Reference in New Issue
Block a user