VirtualBox

Changeset 34039 in vbox


Ignore:
Timestamp:
Nov 12, 2010 6:51:25 PM (14 years ago)
Author:
vboxsync
Message:

NAT: if_encap doesn't allocate intermediate buffer, IP-fragmentation shouldn't allow appear them on the bottom of the stack.

File:
1 edited

Legend:

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

    r33978 r34039  
    15501550    m->m_len += ETH_HLEN;
    15511551    eh = mtod(m, struct ethhdr *);
    1552     mlen = m_length(m, NULL);
     1552    mlen = m->m_len;//m_length(m, NULL);
    15531553
    15541554    if (memcmp(eh->h_source, special_ethaddr, ETH_ALEN) != 0)
     
    15641564        }
    15651565    }
    1566     if (m->m_next)
    1567     {
    1568         buf = RTMemAlloc(mlen);
    1569         if (!buf)
    1570         {
    1571             Log(("NAT: Can't alloc memory for outgoing buffer\n"));
    1572             m_freem(pData, m);
    1573             goto done;
    1574         }
    1575         mbuf = buf;
    1576         m_copydata(m, 0, mlen, (char *)buf);
    1577     }
    1578     else
    1579         mbuf = mtod(m, uint8_t *);
     1566    /*
     1567     * we're processing the chain, that isn't not expected.
     1568     */
     1569    Assert((!m->m_next));
     1570    mbuf = mtod(m, uint8_t *);
    15801571    eh->h_proto = RT_H2N_U16(eth_proto);
    15811572    if (flags & ETH_ENCAP_URG)
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