VirtualBox

Changeset 50015 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 31, 2013 2:57:28 AM (11 years ago)
Author:
vboxsync
Message:

NAT/ip_icmp.c: icmp_error: addss assert statements of correct calculations.

File:
1 edited

Legend:

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

    r50014 r50015  
    725725    m->m_data -= shlen + RT_OFFSETOF(struct icmp, icmp_ip); /* _m_: shifts m_data to the start of ICMP header */
    726726    m->m_len += s_ip_len + shlen + RT_OFFSETOF(struct icmp, icmp_ip); /* _m_: m_len counts bytes in IP payload */
    727    
     727
     728    /**
     729     * It asserts if calculation above is wrong.
     730     */
     731    Assert(icp == mtod(m, struct icmp*));
     732
    728733    icp->icmp_cksum = 0;
    729734    icp->icmp_cksum = cksum(m, m->m_len);
     
    743748    m->m_data -= hlen;
    744749    m->m_len  += hlen;
     750   
     751    /**
     752     * paranoid. if something goes wrong previous assert should be triggered.
     753     */
     754    Assert(ip == mtod(m, struct ip*));
    745755    (void) ip_output0(pData, (struct socket *)NULL, m, 1);
    746756
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