Changeset 15138 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 9, 2008 8:05:22 AM (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
r15136 r15138 79 79 #ifndef RT_OS_WINDOWS 80 80 pData->icmp_socket.s = socket(PF_INET, SOCK_RAW, IPPROTO_ICMP); 81 if (pData->icmp_socket.s == -1) 82 { 83 int rc = RTErrConvertFromErrno(errno); 84 LogRel(("NAT: ICMP/ping not available (could open ICMP socket, error %Rrc)\n", rc, rc)); 85 return 1; 86 } 81 87 insque(pData, &pData->icmp_socket, &udb); 82 88 #else /* RT_OS_WINDOWS */ … … 312 318 if (status < 0) 313 319 { 314 LogRel((" error(%s) occured while setting TTL attribute of IP packet\n", strerror(errno)));320 LogRel(("NAT: Error (%s) occurred while setting TTL attribute of IP packet\n", strerror(errno))); 315 321 } 316 322 if (sendto(pData->icmp_socket.s, icp, icmplen, 0, … … 332 338 { 333 339 error = GetLastError(); 334 LogRel((" error(%d) occured while sending ICMP (", error));340 LogRel(("NAT: Error (%d) occurred while sending ICMP (", error)); 335 341 switch (error) 336 342 { -
trunk/src/VBox/Devices/Network/slirp/socket.c
r15137 r15138 793 793 icm = icmp_find_original_mbuf(pData, ip); 794 794 795 if (icm == NULL) { 796 LogRel(("Can't find the corresponding packet for the received ICMP\n")); 795 if (icm == NULL) 796 { 797 LogRel(("NAT: Can't find the corresponding packet for the received ICMP\n")); 797 798 return; 798 799 } 799 800 800 801 m = icm->im_m; 801 802 Assert(m != NULL); … … 846 847 u_char code = ~0; 847 848 len = pData->pfIcmpParseReplies(pData->pvIcmpBuffer, pData->szIcmpBuffer); 848 if (len <= 0) { 849 LogRel(("Error (%d) occured on ICMP receiving \n", GetLastError())); 849 if (len <= 0) 850 { 851 LogRel(("NAT: Error (%d) occurred on ICMP receiving\n", GetLastError())); 850 852 return; 851 853 } 852 854 LogRel(("IcmpParseReplies returns %ld\n", len)); 853 855 icr = (ICMP_ECHO_REPLY *)pData->pvIcmpBuffer; 854 for (i = 0; i < len; ++i) { 856 for (i = 0; i < len; ++i) 857 { 855 858 switch(icr[i].Status) 856 859 { … … 864 867 case IP_DEST_PORT_UNREACHABLE: 865 868 code = (code != ~0 ? code : ICMP_UNREACH_PORT); 866 icmp_error(pData, so->so_m, ICMP_UNREACH, code, 0, "Error occur ed!!!");869 icmp_error(pData, so->so_m, ICMP_UNREACH, code, 0, "Error occurred!!!"); 867 870 break; 868 871 case IP_SUCCESS: /* echo replied */
Note:
See TracChangeset
for help on using the changeset viewer.