VirtualBox

Changeset 57846 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Sep 21, 2015 7:50:36 PM (9 years ago)
Author:
vboxsync
Message:

SrvIntNetR0: intnetR0NetworkEditDhcpFromIntNet - update UDP checksum
only if present.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r57358 r57846  
    34913491
    34923492                /* Patch UDP checksum */
    3493                 uint32_t uChecksum = (uint32_t)~pUdpHdr->uh_sum + RT_H2BE_U16_C(RTNET_DHCP_FLAG_BROADCAST);
    3494                 while (uChecksum >> 16)
    3495                     uChecksum = (uChecksum >> 16) + (uChecksum & 0xFFFF);
    3496                 uChecksum = ~uChecksum;
    3497                 intnetR0SgWritePart(pSG, (uintptr_t)&pUdpHdr->uh_sum - (uintptr_t)pIpHdr + sizeof(RTNETETHERHDR), sizeof(pUdpHdr->uh_sum), &uChecksum);
     3493                if (pUdpHdr->uh_sum != 0)
     3494                {
     3495                    uint32_t uChecksum = (uint32_t)~pUdpHdr->uh_sum + RT_H2BE_U16_C(RTNET_DHCP_FLAG_BROADCAST);
     3496                    while (uChecksum >> 16)
     3497                        uChecksum = (uChecksum >> 16) + (uChecksum & 0xFFFF);
     3498                    uChecksum = ~uChecksum;
     3499                    intnetR0SgWritePart(pSG,
     3500                                        (uintptr_t)&pUdpHdr->uh_sum - (uintptr_t)pIpHdr + sizeof(RTNETETHERHDR),
     3501                                        sizeof(pUdpHdr->uh_sum),
     3502                                        &uChecksum);
     3503                }
    34983504            }
    34993505
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