VirtualBox

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


Ignore:
Timestamp:
May 6, 2009 6:54:50 AM (16 years ago)
Author:
vboxsync
Message:

NAT: wrong Ether address detection and ethernet gap detection

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

Legend:

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

    r19313 r19411  
    6363    DEBUG_ARG("so = %lx", (long)so);
    6464    DEBUG_ARG("m0 = %lx", (long)m0);
    65     Assert(m->m_data == m->m_dat + if_maxlinkhdr);
     65    if(m->m_data != ((caddr_t)m->m_dat + if_maxlinkhdr))
     66    {
     67        LogRel(("NAT: ethernet detects corruption of the packet"));
     68        AssertMsg(m->m_data == ((caddr_t)m->m_dat + if_maxlinkhdr), ("!!Ethernet frame corrupted!!"));
     69    }
    6670
    6771#if 0 /* We do no options */
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r19392 r19411  
    15161516    if (memcmp(eh->h_source, special_ethaddr, ETH_ALEN) == 0)
    15171517    {
    1518         goto drop;
     1518        /* @todo vasily: add ether logging routine in debug.c */
     1519        Log(("NAT: packet was addressed to other MAC\n"));
     1520        RTMemFree((void *)pkt);
     1521        return;
    15191522    }
    15201523#endif
     
    15621565            break;
    15631566    }
    1564     drop:
    15651567    RTMemFree((void *)pkt);
    15661568}
     
    15751577    m->m_len += ETH_HLEN;
    15761578    eh = mtod(m, struct ethhdr *);
     1579   
     1580    if((caddr_t)eh != (caddr_t)m->m_dat)
     1581    {
     1582        LogRel(("NAT: ethernet detects corruption of the packet"));
     1583        AssertMsg((caddr_t)eh == (caddr_t)m->m_dat, ("!!Ethernet frame corrupted!!"));
     1584    }
    15771585
    15781586#ifndef VBOX_WITH_NAT_SERVICE
     
    15821590    eh->h_source[5] = CTL_ALIAS;
    15831591#else
    1584     Assert((caddr_t)eh == (caddr_t)m->m_dat);
    15851592    if (memcmp(eh->h_source, special_ethaddr, ETH_ALEN) != 0)
    15861593    {
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