VirtualBox

Ignore:
Timestamp:
Dec 12, 2008 5:13:19 PM (16 years ago)
Author:
vboxsync
Message:

slirp:icmp: reverted 40806, 40808

File:
1 edited

Legend:

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

    r15369 r15388  
    795795    struct icmp_msg *icm;
    796796    uint8_t proto;
    797     int hlen;
    798 
    799 #ifndef RT_OS_DARWIN
     797
    800798    ip = (struct ip *)buff;
    801799    icp = (struct icmp *)((char *)ip + (ip->ip_hl << 2));
    802 #else
    803     icp = (struct icmp *)buff;
    804 #endif
    805800
    806801    LogRel(("ICMP:received msg(t:%d, c:%d)\n", icp->icmp_type, icp->icmp_code));
     
    829824    proto = ip->ip_p;
    830825    /* Now ip is pointing on header we've sent from guest */
    831     hlen = ip->ip_hl << 2;
    832826    if (icp->icmp_type == ICMP_TIMXCEED)
    833827    {
    834         old_ip_len = hlen + 64;
     828        old_ip_len = (ip->ip_hl << 2) + 64;
    835829        memcpy(ip_copy, ip, old_ip_len);
    836830    }
     
    840834
    841835    /* overide ther tail of old packet */
    842 #ifdef RT_OS_DARWIN
    843     /* on Darwin don't have IP header in the buffer */
    844     m->m_data += hlen;
    845     m->m_len -= hlen;
    846 #endif
    847836    memcpy(m->m_data, buff, len);
    848837    m->m_len = len;
    849 #ifdef RT_OS_DARWIN
    850     /* on Darwin don't have IP header in the buffer */
    851     m->m_data -= hlen;
    852     m->m_len += hlen;
    853 #endif
    854838    ip = mtod(m, struct ip *); /* ip is from mbuf we've overrided */
    855839
     
    863847
    864848    /* the low level expects fields to be in host format so let's convert them*/
    865 #ifndef RT_OS_DARWIN
    866     /*On Darwin we don't get this fields from socket*/
    867849    NTOHS(ip->ip_len);
    868850    NTOHS(ip->ip_off);
    869851    NTOHS(ip->ip_id);
    870 #endif
    871852    ip->ip_src.s_addr = src;
    872853    ip->ip_dst.s_addr = dst;
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