VirtualBox

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


Ignore:
Timestamp:
Jul 31, 2014 12:06:03 PM (10 years ago)
Author:
vboxsync
Message:

NAT: Drop packets to multicast destinations, the rest of the code is
not prepared to handle multicast meaningfully and doesn't do IGMP.
While here, drop packets to reserved class e addresses too (except to
255.255.255.255 limited broadcast) and drop packets with non-unicast
source addresses.

File:
1 edited

Legend:

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

    r50017 r52245  
    192192        m_adj(m, ip->ip_len - m->m_len);
    193193
     194    /* source must be unicast */
     195    if ((ip->ip_src.s_addr & RT_N2H_U32_C(0xe0000000)) == RT_N2H_U32_C(0xe0000000))
     196        goto free_m;
     197
    194198    /* check ip_ttl for a correct ICMP reply */
    195199    if (ip->ip_ttl==0 || ip->ip_ttl == 1)
     
    201205
    202206    ip->ip_ttl--;
     207
     208    /*
     209     * Drop multicast (class d) and reserved (class e) here.  The rest
     210     * of the code is not yet prepared to deal with it.  IGMP is not
     211     * implemented either.
     212     */
     213    if (   (ip->ip_dst.s_addr & RT_N2H_U32_C(0xe0000000)) == RT_N2H_U32_C(0xe0000000)
     214        && ip->ip_dst.s_addr != 0xffffffff)
     215    {
     216        goto free_m;
     217    }
     218
    203219    /*
    204220     * If offset or IP_MF are set, must reassemble.
     
    244260    Log2(("NAT: IP datagram to %RTnaipv4 with size(%d) claimed as bad\n",
    245261        ip->ip_dst, ip->ip_len));
     262free_m:
    246263    m_freem(pData, m);
    247264no_free_m:
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