Changeset 15388 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Dec 12, 2008 5:13:19 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/socket.c
r15369 r15388 795 795 struct icmp_msg *icm; 796 796 uint8_t proto; 797 int hlen; 798 799 #ifndef RT_OS_DARWIN 797 800 798 ip = (struct ip *)buff; 801 799 icp = (struct icmp *)((char *)ip + (ip->ip_hl << 2)); 802 #else803 icp = (struct icmp *)buff;804 #endif805 800 806 801 LogRel(("ICMP:received msg(t:%d, c:%d)\n", icp->icmp_type, icp->icmp_code)); … … 829 824 proto = ip->ip_p; 830 825 /* Now ip is pointing on header we've sent from guest */ 831 hlen = ip->ip_hl << 2;832 826 if (icp->icmp_type == ICMP_TIMXCEED) 833 827 { 834 old_ip_len = hlen+ 64;828 old_ip_len = (ip->ip_hl << 2) + 64; 835 829 memcpy(ip_copy, ip, old_ip_len); 836 830 } … … 840 834 841 835 /* overide ther tail of old packet */ 842 #ifdef RT_OS_DARWIN843 /* on Darwin don't have IP header in the buffer */844 m->m_data += hlen;845 m->m_len -= hlen;846 #endif847 836 memcpy(m->m_data, buff, len); 848 837 m->m_len = len; 849 #ifdef RT_OS_DARWIN850 /* on Darwin don't have IP header in the buffer */851 m->m_data -= hlen;852 m->m_len += hlen;853 #endif854 838 ip = mtod(m, struct ip *); /* ip is from mbuf we've overrided */ 855 839 … … 863 847 864 848 /* the low level expects fields to be in host format so let's convert them*/ 865 #ifndef RT_OS_DARWIN866 /*On Darwin we don't get this fields from socket*/867 849 NTOHS(ip->ip_len); 868 850 NTOHS(ip->ip_off); 869 851 NTOHS(ip->ip_id); 870 #endif871 852 ip->ip_src.s_addr = src; 872 853 ip->ip_dst.s_addr = dst;
Note:
See TracChangeset
for help on using the changeset viewer.