VirtualBox

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


Ignore:
Timestamp:
May 8, 2009 1:53:56 PM (16 years ago)
Author:
vboxsync
Message:

NAT: Correct ethernet package check

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

Legend:

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

    r19411 r19525  
    6363    DEBUG_ARG("so = %lx", (long)so);
    6464    DEBUG_ARG("m0 = %lx", (long)m0);
    65     if(m->m_data != ((caddr_t)m->m_dat + if_maxlinkhdr))
     65    if(m->m_data != (MBUF_HEAD(m) + if_maxlinkhdr))
    6666    {
    6767        LogRel(("NAT: ethernet detects corruption of the packet"));
    68         AssertMsg(m->m_data == ((caddr_t)m->m_dat + if_maxlinkhdr), ("!!Ethernet frame corrupted!!"));
     68        AssertMsgFailed(("!!Ethernet frame corrupted!!"));
    6969    }
    7070
  • trunk/src/VBox/Devices/Network/slirp/mbuf.h

    r15453 r19525  
    142142struct mbuf * dtom _P((PNATState, void *));
    143143
     144/*
     145 * this macro should be used for validation and copying of Ethernet header where it really requred
     146 */
     147#define MBUF_HEAD(m) ((caddr_t)(((m)->m_flags & M_EXT) ? (m)->m_ext : (m)->m_dat))
     148
    144149#endif
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r19411 r19525  
    15781578    eh = mtod(m, struct ethhdr *);
    15791579   
    1580     if((caddr_t)eh != (caddr_t)m->m_dat)
     1580    if(MBUF_HEAD(m) != m->m_data)
    15811581    {
    15821582        LogRel(("NAT: ethernet detects corruption of the packet"));
    1583         AssertMsg((caddr_t)eh == (caddr_t)m->m_dat, ("!!Ethernet frame corrupted!!"));
     1583        AssertMsgFailed(("!!Ethernet frame corrupted!!"));
    15841584    }
    15851585
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