VirtualBox

Ignore:
Timestamp:
Jul 12, 2018 9:06:33 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123672
Message:

*: Made RT_UOFFSETOF, RT_OFFSETOF, RT_UOFFSETOF_ADD and RT_OFFSETOF_ADD work like builtin_offsetof() and require compile time resolvable requests, adding RT_UOFFSETOF_DYN for the dynamic questions that can only be answered at runtime.

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/bootp.c

    r70842 r73097  
    863863    size_t vlen;
    864864
    865     if (mlen < RT_OFFSETOF(struct bootp_t, bp_vend) + sizeof(rfc1533_cookie))
     865    if (mlen < RT_UOFFSETOF(struct bootp_t, bp_vend) + sizeof(rfc1533_cookie))
    866866    {
    867867        LogRelMax(50, ("NAT: ignoring invalid BOOTP request (mlen %u too short)\n", mlen));
     
    893893    }
    894894
    895     vlen = mlen - RT_OFFSETOF(struct bootp_t, bp_vend);
     895    vlen = mlen - RT_UOFFSETOF(struct bootp_t, bp_vend);
    896896    dhcp_decode(pData, bp, vlen);
    897897}
  • trunk/src/VBox/Devices/Network/slirp/ip_icmpwin.c

    r69500 r73097  
    155155    bufsize += 16; /* whatever that is; empirically at least XP needs it */
    156156
    157     pongsize = RT_OFFSETOF(struct pong, buf) + bufsize;
     157    pongsize = RT_UOFFSETOF(struct pong, buf) + bufsize;
    158158    if (pData->cbIcmpPending + pongsize > 1024 * 1024)
    159159        return;
     
    327327        size_t sz;
    328328
    329         sz = RT_OFFSETOF(struct pong, buf) + pong->bufsize;
     329        sz = RT_UOFFSETOF(struct pong, buf) + pong->bufsize;
    330330        Assert(pData->cbIcmpPending >= sz);
    331331        pData->cbIcmpPending -= sz;
  • trunk/src/VBox/Devices/Network/slirp/tftp.c

    r69500 r73097  
    266266
    267267    pszTftpRRQRaw = (char *)&pcTftpIpHeader->Core;
    268     cbTftpRRQRaw = RT_H2N_U16(pcTftpIpHeader->UdpHdr.uh_ulen) + sizeof(struct ip) - RT_OFFSETOF(TFTPIPHDR, Core);
     268    cbTftpRRQRaw = RT_H2N_U16(pcTftpIpHeader->UdpHdr.uh_ulen) + sizeof(struct ip) - RT_UOFFSETOF(TFTPIPHDR, Core);
    269269    while (cbTftpRRQRaw)
    270270    {
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