Changeset 40583 in vbox
- Timestamp:
- Mar 23, 2012 4:20:59 AM (13 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c
r40423 r40583 798 798 NSOCK_INC_EX(la); 799 799 if (link_type == LINK_TCP) 800 { 801 so->so_type = IPPROTO_TCP; 800 802 insque(la->pData, so, &la->tcb); 803 } 801 804 else if (link_type == LINK_UDP) 805 { 806 so->so_type = IPPROTO_UDP; 802 807 insque(la->pData, so, &la->udb); 808 } 803 809 else 810 { 811 /* socket wasn't added to queue */ 812 closesocket(so->s); 813 RTMemFree(so); 804 814 Assert(!"Shouldn't be here"); 815 return 0; 816 } 805 817 LogFunc(("bind called for socket: %R[natsock]\n", so)); 806 818 #else -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r40423 r40583 926 926 QSOCKET_FOREACH(so, so_next, tcp) 927 927 /* { */ 928 Assert(so->so_type == IPPROTO_TCP); 928 929 #if !defined(RT_OS_WINDOWS) 929 930 so->so_poll_index = -1; … … 1012 1013 /* { */ 1013 1014 1015 Assert(so->so_type == IPPROTO_UDP); 1014 1016 STAM_COUNTER_INC(&pData->StatUDP); 1015 1017 #if !defined(RT_OS_WINDOWS) -
trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
r40423 r40583 227 227 228 228 so->so_tcpcb = tp; 229 so->so_type = IPPROTO_TCP; 229 230 230 231 return (tp); … … 598 599 tcp_attach(PNATState pData, struct socket *so) 599 600 { 601 /* We're attaching already attached socket??? */ 602 Assert(so->so_type == 0); 600 603 if ((so->so_tcpcb = tcp_newtcpcb(pData, so)) == NULL) 601 604 return -1; -
trunk/src/VBox/Devices/Network/slirp/udp.c
r40283 r40583 271 271 so->so_faddr = ip->ip_dst; /* XXX */ 272 272 so->so_fport = uh->uh_dport; /* XXX */ 273 Assert(so->so_type == IPPROTO_UDP); 273 274 274 275 /* … … 346 347 LogFlowFunc(("ENTER: so = %R[natsock], m = %p, saddr = %RTnaipv4, daddr = %RTnaipv4\n", 347 348 so, m, saddr->sin_addr.s_addr, daddr->sin_addr.s_addr)); 349 350 /* in case of built-in service so might be NULL */ 351 if (so) Assert(so->so_type == IPPROTO_UDP); 348 352 349 353 /* … … 399 403 struct socket *pSocketClone = NULL; 400 404 #endif 405 Assert(so->so_type == IPPROTO_UDP); 401 406 LogFlowFunc(("ENTER: so = %R[natsock], m = %p, saddr = %RTnaipv4\n", 402 407 so, (long)m, addr->sin_addr.s_addr)); … … 456 461 int opt = 1; 457 462 463 /* We attaching some olready attched socket ??? */ 464 Assert(so->so_type == 0); 458 465 if ((so->s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) 459 466 goto error; … … 497 504 NSOCK_INC(); 498 505 QSOCKET_UNLOCK(udb); 506 so->so_type = IPPROTO_UDP; 499 507 return so->s; 500 508 error: … … 508 516 if (so != &pData->icmp_socket) 509 517 { 518 Assert(so->so_type == IPPROTO_UDP); 510 519 QSOCKET_LOCK(udb); 511 520 SOCKET_LOCK(so); … … 552 561 } 553 562 so->so_expire = curtime + SO_EXPIRE; 563 so->so_type = IPPROTO_UDP; 554 564 fd_nonblock(so->s); 555 565 SOCKET_LOCK_CREATE(so); … … 582 592 * if statement was always true (INADDR_ANY=0). */ 583 593 /* if (addr.sin_addr.s_addr == 0 || addr.sin_addr.s_addr == loopback_addr.s_addr) */ 594 /* @todo: vvl - alias_addr should be set (if required) 595 * later by liabalias module. 596 */ 584 597 if (1 == 0) /* always use the else part */ 585 598 so->so_faddr = alias_addr;
Note:
See TracChangeset
for help on using the changeset viewer.