VirtualBox

Ignore:
Timestamp:
Aug 1, 2008 2:20:15 AM (16 years ago)
Author:
vboxsync
Message:

RTNetIPv4IsUDPValid: the UDP checksum is optional, so don't fail if it's not set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/checksum/ipv4.cpp

    r11049 r11060  
    448448    if (RT_UNLIKELY(!rtNetIPv4IsUDPSizeValid(pIpHdr, pUdpHdr, cbPktMax)))
    449449        return false;
    450     uint16_t u16Sum = RTNetIPv4UDPChecksum(pIpHdr, pUdpHdr, pvData);
    451     if (RT_UNLIKELY(pUdpHdr->uh_sum != u16Sum))
    452         return false;
     450    if (pUdpHdr->uh_sum)
     451    {
     452        uint16_t u16Sum = RTNetIPv4UDPChecksum(pIpHdr, pUdpHdr, pvData);
     453        if (RT_UNLIKELY(pUdpHdr->uh_sum != u16Sum))
     454            return false;
     455    }
    453456    return true;
    454457}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette