Changeset 40786 in vbox
- Timestamp:
- Apr 6, 2012 7:32:46 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c
r40623 r40786 780 780 sock_addr.sin_family = AF_INET; 781 781 sock_addr.sin_addr.s_addr = htonl(INADDR_ANY); 782 #if 0 782 783 sock_addr.sin_port = htons(port_net); 784 #endif 783 785 #ifdef RT_OS_DARWIN 784 786 sock_addr.sin_len = sizeof(struct sockaddr_in); … … 802 804 return 0; 803 805 } 806 so->so_laddr.s_addr = la->aliasAddress.s_addr; 807 so->so_lport = htons(port_net); 808 so->so_faddr.s_addr = la->true_addr.s_addr; 809 so->so_fport = la->true_port; 804 810 so->so_hlport = ((struct sockaddr_in *)&sa_addr)->sin_port; 805 811 so->so_hladdr.s_addr = … … 808 814 if (link_type == LINK_TCP) 809 815 { 810 so->so_type = IPPROTO_TCP; 811 insque(la->pData, so, &la->tcb); 816 int ret = 0; 817 struct sockaddr_in sin; 818 RT_ZERO(sin); 819 sin.sin_family = AF_INET; 820 sin.sin_addr.s_addr = so->so_faddr.s_addr; 821 sin.sin_port = so->so_fport; 822 ret = connect(so->s, (struct sockaddr *)&sin, sizeof(sin)); 823 if ( ret < 0 824 && errno == EINPROGRESS 825 && errno == EAGAIN 826 && errno == EWOULDBLOCK) 827 { 828 closesocket(so->s); 829 RTMemFree(so); 830 return 0; 831 } 832 so->so_state = SS_ISFCONNECTING; /* slirp happy??? */ 833 tcp_attach(la->pData, so); 834 /* tcp_{snd,rcv}space -> pData->tcp_{snd,rcv}space */ 835 sbreserve(la->pData, &so->so_snd, la->tcp_sndspace); 836 sbreserve(la->pData, &so->so_rcv, la->tcp_rcvspace); 812 837 } 813 838 else if (link_type == LINK_UDP)
Note:
See TracChangeset
for help on using the changeset viewer.