- Timestamp:
- Oct 12, 2020 8:42:38 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmnetinline.h
r85149 r86535 543 543 if (iSeg == 0) 544 544 { 545 Assert(pGso->offHdr2 + sizeof(uint16_t) <= cbFrame); 546 /* uh_ulen cannot exceed cbFrame - pGso->offHdr2 (offset of UDP header) */ 547 if ((unsigned)(pGso->offHdr2 + RT_BE2H_U16(((PCRTNETUDP)&pbFrame[pGso->offHdr2])->uh_ulen)) > cbFrame) 545 /* uh_ulen shall not exceed cbFrame - pGso->offHdr2 (offset of UDP header) */ 546 PRTNETUDP pUdpHdr = (PRTNETUDP)&pbFrame[pGso->offHdr2]; 547 Assert(pGso->offHdr2 + RT_UOFFSET_AFTER(RTNETUDP, uh_ulen) <= cbFrame); 548 if ((unsigned)(pGso->offHdr2 + RT_BE2H_U16(pUdpHdr->uh_ulen)) > cbFrame) 548 549 { 549 if (cbFrame > UINT16_MAX) 550 ((PRTNETUDP)&pbFrame[pGso->offHdr2])->uh_ulen = 0xFFFF; 550 size_t cbUdp = cbFrame - pGso->offHdr2; 551 if (cbUdp >= UINT16_MAX) 552 pUdpHdr->uh_ulen = UINT16_MAX; 551 553 else 552 ((PRTNETUDP)&pbFrame[pGso->offHdr2])->uh_ulen = RT_H2BE_U16((uint16_t)(cbFrame - pGso->offHdr2));554 pUdpHdr->uh_ulen = RT_H2BE_U16((uint16_t)cbUdp); 553 555 } 554 Assert((unsigned)(pGso->offHdr2 + ((PCRTNETUDP)&pbFrame[pGso->offHdr2])->uh_ulen) <= cbFrame);555 556 pdmNetGsoUpdateUdpHdrUfo(RTNetIPv4PseudoChecksum((PRTNETIPV4)&pbFrame[pGso->offHdr1]), 556 557 pbSegHdrs, pbFrame, pGso->offHdr2);
Note:
See TracChangeset
for help on using the changeset viewer.