Changeset 15447 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Dec 13, 2008 7:10:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/socket.c
r15445 r15447 79 79 udp_last_so = &udb; 80 80 81 m_free(pData, so->so_m); 81 /* check if mbuf haven't been already freed */ 82 if (so->so_m != NULL) 83 m_free(pData, so->so_m); 82 84 83 85 if(so->so_next && so->so_prev) … … 802 804 803 805 LogRel(("ICMP:received msg(t:%d, c:%d)\n", icp->icmp_type, icp->icmp_code)); 804 if (icp->icmp_type != ICMP_ECHOREPLY && icp->icmp_type != ICMP_TIMXCEED) 806 if (icp->icmp_type != ICMP_ECHOREPLY 807 && icp->icmp_type != ICMP_TIMXCEED 808 && icp->icmp_type != ICMP_UNREACH) 805 809 { 806 810 return; 807 811 } 808 812 809 if (icp->icmp_type == ICMP_TIMXCEED) 813 if (icp->icmp_type == ICMP_TIMXCEED 814 || icp->icmp_type == ICMP_UNREACH ) 810 815 ip = &icp->icmp_ip; 811 816 … … 826 831 proto = ip->ip_p; 827 832 /* Now ip is pointing on header we've sent from guest */ 828 if (icp->icmp_type == ICMP_TIMXCEED) 833 if (icp->icmp_type == ICMP_TIMXCEED 834 || icp->icmp_type == ICMP_UNREACH) 829 835 { 830 836 old_ip_len = (ip->ip_hl << 2) + 64; … … 845 851 846 852 icp = (struct icmp *)((char *)ip + (ip->ip_hl << 2)); 847 if (icp->icmp_type == ICMP_TIMXCEED) 853 if (icp->icmp_type == ICMP_TIMXCEED 854 || icp->icmp_type == ICMP_UNREACH) 848 855 { 849 856 /* according RFC 793 error messages required copy of initial IP header + 64 bit */ … … 857 864 LIST_REMOVE(icm, im_list); 858 865 /* Don't call m_free here*/ 859 #if 0 860 if (icp->icmp_type == ICMP_TIMXCEED) 861 { 866 867 if (icp->icmp_type == ICMP_TIMXCEED 868 || icp->icmp_type == ICMP_UNREACH) 869 { 870 icm->im_so->so_m = NULL; 862 871 switch (proto) 863 872 { 864 873 case IPPROTO_UDP: 865 874 /*XXX: so->so_m already freed so we shouldn't call sofree */ 866 if (so == udp_last_so) 867 udp_last_so = &udb; 868 closesocket(icm->im_so->s); 869 icm->im_so->s = 1; 870 icm->im_so->so_state = SS_NOFDREF; 871 if(so->so_next && so->so_prev) { 872 remque(pData, so); 873 free(icm->im_so); 874 } 875 udp_detach(pData, icm->im_so); 875 876 break; 876 877 case IPPROTO_TCP: … … 882 883 } 883 884 } 884 #endif885 885 free(icm); 886 886 }
Note:
See TracChangeset
for help on using the changeset viewer.