VirtualBox

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


Ignore:
Timestamp:
Dec 9, 2020 3:24:48 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141840
Message:

Dev/E1000: (bugref:9883) No more zero UDP checksums.

File:
1 edited

Legend:

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

    r86574 r87071  
    41574157 * @param   cse         Offset in packet to stop computing
    41584158 *                      checksum at.
     4159 * @param   fUdp        Replace 0 checksum with all 1s.
    41594160 * @thread  E1000_TX
    41604161 */
    4161 static void e1kInsertChecksum(PE1KSTATE pThis, uint8_t *pPkt, uint16_t u16PktLen, uint8_t cso, uint8_t css, uint16_t cse)
     4162static void e1kInsertChecksum(PE1KSTATE pThis, uint8_t *pPkt, uint16_t u16PktLen, uint8_t cso, uint8_t css, uint16_t cse, bool fUdp = false)
    41624163{
    41634164    RT_NOREF1(pThis);
     
    41874188
    41884189    uint16_t u16ChkSum = e1kCSum16(pPkt + css, cse - css + 1);
     4190    if (fUdp && u16ChkSum == 0)
     4191        u16ChkSum = ~u16ChkSum;     /* 0 means no checksum computed in case of UDP (see @bugref{9883}) */
    41894192    E1kLog2(("%s Inserting csum: %04X at %02X, old value: %04X\n", pThis->szPrf,
    41904193             u16ChkSum, cso, *(uint16_t*)(pPkt + cso)));
     
    49124915                                              pThis->contextNormal.tu.u8CSO,
    49134916                                              pThis->contextNormal.tu.u8CSS,
    4914                                               pThis->contextNormal.tu.u16CSE);
     4917                                              pThis->contextNormal.tu.u16CSE,
     4918                                              !pThis->contextNormal.dw2.fTCP);
    49154919                        e1kTransmitFrame(pDevIns, pThis, pThisCC, fOnWorkerThread);
    49164920                    }
     
    51075111                                                  pThis->contextNormal.tu.u8CSO,
    51085112                                                  pThis->contextNormal.tu.u8CSS,
    5109                                                   pThis->contextNormal.tu.u16CSE);
     5113                                                  pThis->contextNormal.tu.u16CSE,
     5114                                                  !pThis->contextNormal.dw2.fTCP);
    51105115                            e1kTransmitFrame(pDevIns, pThis, pThisCC, fOnWorkerThread);
    51115116                        }
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