- Timestamp:
- Dec 9, 2008 4:43:23 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r15149 r15190 129 129 struct ip *ip0; 130 130 struct icmp *icp, *icp0; 131 struct icmp_msg *icm ;131 struct icmp_msg *icm = NULL; 132 132 int found = 0; 133 133 struct socket *head_socket; -
trunk/src/VBox/Devices/Network/slirp/socket.c
r15149 r15190 847 847 struct mbuf *m; 848 848 struct icmp *icp; 849 struct icmp_msg *icm; 850 struct ip *ip_broken; /* ICMP returns header + 64 bit of packet */ 851 uint32_t src; 849 852 ICMP_ECHO_REPLY *icr; 850 853 u_char code = ~0; … … 878 881 ip->ip_p = IPPROTO_ICMP; 879 882 ip->ip_dst.s_addr = so->so_laddr.s_addr; /*XXX: still the hack*/ 880 ip->ip_hl = sizeof(struct ip) >> 2; 883 ip->ip_hl = sizeof(struct ip) >> 2; /* requiered for icmp_reflect, no IP options */ 884 ip->ip_ttl = icr[i].Options.Ttl; 881 885 882 886 icp = (struct icmp *)&ip[1]; /* no options */ … … 891 895 892 896 icmp_reflect(pData, m); 893 m_free(pData, m);894 897 case IP_TTL_EXPIRED_TRANSIT: /* TTL expired */ 895 LogRel(("ICMP: message with Status: %x was received from %x\n", icr[i].Status, icr[i].Address)); 896 LogRel(("ICMP: IP(v %hd, l %hd )\n", ip->ip_v, ip->ip_hl)); 898 899 ip_broken = icr[i].Data; 900 icm = icmp_find_original_mbuf(pData, ip_broken); 901 if (icm == NULL) { 902 LogRel(("ICMP: can't find original package (first double word %x)\n", *(uint32_t *)ip_broken)); 903 return; 904 } 905 m = icm->im_m; 906 ip = mtod(m, struct ip *); 907 ip->ip_ttl = icr[i].Options.Ttl; 908 src = ip->ip_src.s_addr; 909 ip->ip_dst.s_addr = src; 910 ip->ip_dst.s_addr = icr[i].Address; 911 icp = (struct icmp *)((char *)ip + (ip->ip_hl << 2)); 912 ip_broken->ip_src.s_addr = src; /*it packet sent from host not from guest*/ 913 memcpy(icp->icmp_data, ip_broken, (ip_broken->ip_hl << 2) + 64); 914 icmp_reflect(pData, m); 897 915 break; 898 916 default:
Note:
See TracChangeset
for help on using the changeset viewer.