vbox的更動 51684 路徑 trunk/src/VBox/NetworkServices
- 時間撮記:
- 2014-6-21 下午11:34:16 (10 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/NetworkServices/NAT/pxping.c
r51682 r51684 1211 1211 struct ping_pcb *pcb; 1212 1212 u16_t guest_id; 1213 u16_t oipsum; 1213 1214 u32_t sum; 1214 1215 … … 1264 1265 1265 1266 /* rewrite IP header */ 1266 sum = (u16_t)~IPH_CHKSUM(iph); 1267 sum += chksum_update_32((u32_t *)&iph->dest, 1267 oipsum = IPH_CHKSUM(iph); 1268 if (oipsum == 0) { 1269 /* Solaris doesn't compute checksum for local replies */ 1270 ip_addr_copy(iph->dest, guest_ip); 1271 if (mapped == PXREMAP_MAPPED) { 1272 ip_addr_copy(iph->src, target_ip); 1273 } 1274 else { 1275 IPH_TTL_SET(iph, IPH_TTL(iph) - 1); 1276 } 1277 IPH_CHKSUM_SET(iph, inet_chksum(iph, ntohs(IPH_LEN(iph)))); 1278 } 1279 else { 1280 sum = (u16_t)~oipsum; 1281 sum += chksum_update_32((u32_t *)&iph->dest, 1268 1282 ip4_addr_get_u32(&guest_ip)); 1269 if (mapped == PXREMAP_MAPPED) {1270 sum += chksum_update_32((u32_t *)&iph->src,1283 if (mapped == PXREMAP_MAPPED) { 1284 sum += chksum_update_32((u32_t *)&iph->src, 1271 1285 ip4_addr_get_u32(&target_ip)); 1272 } 1273 else { 1274 IPH_TTL_SET(iph, IPH_TTL(iph) - 1); 1275 sum += PP_NTOHS(~0x0100); 1276 } 1277 sum = FOLD_U32T(sum); 1278 IPH_CHKSUM_SET(iph, ~sum); 1286 } 1287 else { 1288 IPH_TTL_SET(iph, IPH_TTL(iph) - 1); 1289 sum += PP_NTOHS(~0x0100); 1290 } 1291 sum = FOLD_U32T(sum); 1292 IPH_CHKSUM_SET(iph, ~sum); 1293 } 1279 1294 1280 1295 pxping_pmgr_forward_inbound(pxping, iplen);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器