- Timestamp:
- Nov 21, 2013 11:48:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NAT/pxping.c
r49616 r49617 946 946 } 947 947 948 949 /* 950 * Is this a reply to one of our pings? 951 */ 952 948 953 ip_addr_copy(target_ip, iph->src); 949 954 mapped = pxremap_inbound_ip4(&target_ip, &target_ip); … … 971 976 972 977 sys_mutex_unlock(&pxping->lock); 978 979 980 /* 981 * Rewrite headers and forward to guest. 982 */ 973 983 974 984 /* rewrite ICMP echo header */ … … 1018 1028 icmph = (struct icmp_echo_hdr *)(pollmgr_udpbuf + IP_HLEN); 1019 1029 1030 /* 1031 * Inner IP datagram is not checked by the kernel and may be 1032 * anything, possibly malicious. 1033 */ 1034 1020 1035 oipoff = IP_HLEN + ICMP_HLEN; 1021 1036 oiplen = iplen - oipoff; /* NB: truncated length, not IPH_LEN(oiph) */ … … 1073 1088 DPRINTF2(("%s: ping %s id 0x%x seq %d", 1074 1089 __func__, addrstr, ntohs(id), ntohs(seq))); 1075 } 1076 1077 if (ICMPH_TYPE(icmph) == ICMP_DUR) { 1078 DPRINTF2((" unreachable (code %d)\n", ICMPH_CODE(icmph))); 1079 } 1080 else { 1081 DPRINTF2((" time exceeded\n")); 1082 } 1090 if (ICMPH_TYPE(icmph) == ICMP_DUR) { 1091 DPRINTF2((" unreachable (code %d)\n", ICMPH_CODE(icmph))); 1092 } 1093 else { 1094 DPRINTF2((" time exceeded\n")); 1095 } 1096 } 1097 1098 1099 /* 1100 * Is the inner (failed) datagram one of our pings? 1101 */ 1083 1102 1084 1103 ip_addr_copy(target_ip, oiph->dest); /* inner (failed) */ … … 1103 1122 1104 1123 sys_mutex_unlock(&pxping->lock); 1124 1125 1126 /* 1127 * Rewrite both inner and outer headers and forward to guest. 1128 * Note that the checksum of the outer ICMP error message is 1129 * preserved by the changes we do to inner headers. 1130 */ 1105 1131 1106 1132 ip_addr_copy(error_ip, iph->src); /* node that reports the error */ … … 1130 1156 sum = FOLD_U32T(sum); 1131 1157 IPH_CHKSUM_SET(oiph, ~sum); 1132 1133 /* keep outer ICMP error header: checksum not affected by the above */1134 1158 1135 1159 /* rewrite outer IP header */
Note:
See TracChangeset
for help on using the changeset viewer.