Changeset 16293 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Jan 28, 2009 6:19:18 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
r16226 r16293 189 189 { 190 190 found = 1; 191 Log(("Have found %R[natsock]\n", icm->im_so)); 191 192 break; 192 193 } … … 275 276 icm = RTMemAlloc(sizeof(struct icmp_msg)); 276 277 icm->im_m = m; 278 icm->im_so = m->m_so; 277 279 LIST_INSERT_HEAD(&pData->icmp_msg_head, icm, im_list); 278 280 return 0; … … 371 373 if (pData->icmp_socket.s != -1) 372 374 { 375 m->m_so = &pData->icmp_socket; 373 376 icmp_attach(pData, m); 374 377 ttl = ip->ip_ttl; … … 382 385 (struct sockaddr *)&addr, sizeof(addr)) == -1) 383 386 { 384 DEBUG_MISC((dfd,"icmp_input udp sendto tx errno = %d-%s\n",387 Log((dfd,"icmp_input udp sendto tx errno = %d-%s\n", 385 388 errno, strerror(errno))); 386 389 icmp_error(pData, m, ICMP_UNREACH,ICMP_UNREACH_NET, 0, strerror(errno)); … … 403 406 pData->icmp_socket.so_icmp_id = icp->icmp_id; 404 407 pData->icmp_socket.so_icmp_seq = icp->icmp_seq; 408 m->m_so = &pData->icmp_socket; 405 409 memset(&ipopt, 0, sizeof(IP_OPTION_INFORMATION)); 406 410 ipopt.Ttl = ip->ip_ttl; 407 status = ICMP_SEND_ECHO(pData->phEvents[VBOX_ICMP_EVENT_INDEX], notify_slirp, addr.sin_addr.s_addr, 411 status = ICMP_SEND_ECHO(pData->phEvents[VBOX_ICMP_EVENT_INDEX], notify_slirp, addr.sin_addr.s_addr, 408 412 icp->icmp_data, icmplen - ICMP_MINLEN, &ipopt); 409 413 if (status == 0 && (error = GetLastError()) != ERROR_IO_PENDING) … … 631 635 } 632 636 #if defined(RT_OS_WINDOWS) && !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 633 static void WINAPI 637 static void WINAPI 634 638 notify_slirp(void *ctx) 635 639 { -
trunk/src/VBox/Devices/Network/slirp/socket.c
r16291 r16293 72 72 /* 73 73 * remque and free a socket, clobber cache 74 * VBOX_WITH_SLIRP_MT: before sofree queue should be locked, because 75 * in sofree we don't know from which queue item beeing removed. 74 * VBOX_WITH_SLIRP_MT: before sofree queue should be locked, because 75 * in sofree we don't know from which queue item beeing removed. 76 76 */ 77 77 void … … 467 467 m->m_data += if_maxlinkhdr; 468 468 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 469 m->m_data += sizeof(struct udphdr) 469 m->m_data += sizeof(struct udphdr) 470 470 + sizeof(struct ip); /*XXX: no options atm*/ 471 471 #endif … … 650 650 } 651 651 652 SOCKET_LOCK_CREATE(so); 652 SOCKET_LOCK_CREATE(so); 653 653 SOCKET_LOCK(so); 654 654 QSOCKET_LOCK(tcb); … … 816 816 struct icmp_msg *icm; 817 817 uint8_t proto; 818 int type = 0; 818 819 819 820 ip = (struct ip *)buff; … … 829 830 } 830 831 831 if ( icp->icmp_type == ICMP_TIMXCEED 832 || icp->icmp_type == ICMP_UNREACH) 832 type = icp->icmp_type; 833 if ( type == ICMP_TIMXCEED 834 || type == ICMP_UNREACH) 833 835 { 834 836 ip = &icp->icmp_ip; … … 878 880 879 881 icp = (struct icmp *)((char *)ip + (ip->ip_hl << 2)); 880 if ( icp->icmp_type == ICMP_TIMXCEED 881 || icp->icmp_type == ICMP_UNREACH) 882 type = icp->icmp_type; 883 if ( type == ICMP_TIMXCEED 884 || type == ICMP_UNREACH) 882 885 { 883 886 /* according RFC 793 error messages required copy of initial IP header + 64 bit */ … … 892 895 /* Don't call m_free here*/ 893 896 894 if ( icp->icmp_type == ICMP_TIMXCEED895 || icp->icmp_type == ICMP_UNREACH)897 if ( type == ICMP_TIMXCEED 898 || type == ICMP_UNREACH) 896 899 { 897 900 icm->im_so->so_m = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.