Skip to content

Commit

Permalink
Use correct length increment for msg_controllen (#3065)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzikm authored and csujedihy committed Sep 14, 2022
1 parent e8dfa0b commit 1dfe7c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platform/datapath_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,9 @@ CxPlatSocketSendInternal(
*(int *)CMSG_DATA(CMsg) = SendData->ECN;

if (!Socket->Connected) {
Mhdr->msg_controllen += CMSG_SPACE(sizeof(struct in6_pktinfo));
Mhdr->msg_controllen += RemoteAddress->Ip.sa_family == QUIC_ADDRESS_FAMILY_INET
? CMSG_SPACE(sizeof(struct in_pktinfo))
: CMSG_SPACE(sizeof(struct in6_pktinfo));
CMsg = CMSG_NXTHDR(Mhdr, CMsg);
CXPLAT_DBG_ASSERT(LocalAddress != NULL);
CXPLAT_DBG_ASSERT(CMsg != NULL);
Expand Down

0 comments on commit 1dfe7c9

Please sign in to comment.