Changeset 58555 in vbox
- Timestamp:
- Nov 4, 2015 3:34:28 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/Network/lwip-new/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/lwip-new/src/core/tcp.c
r58549 r58555 601 601 lpcb->accept_any_ip_version = 0; 602 602 #endif /* LWIP_IPV6 */ 603 #if LWIP_CONNECTION_PROXY 604 lpcb->accept_on_syn = 0; 605 #endif 603 606 ipX_addr_copy(PCB_ISIPV6(pcb), lpcb->local_ip, pcb->local_ip); 604 607 if (pcb->local_port != 0) { … … 1559 1562 { 1560 1563 tcp_proxy_accept_callback = accept; 1564 } 1565 1566 1567 /** 1568 * A cross between normal accept and proxy early accept. Like with 1569 * normal accept there's a normal LISTENing pcb. Like with proxy, the 1570 * accept callback will be called on the first SYN. 1571 */ 1572 void 1573 tcp_accept_syn(struct tcp_pcb *pcb, tcp_accept_fn accept) 1574 { 1575 struct tcp_pcb_listen *lpcb; 1576 1577 LWIP_ASSERT("invalid socket state for accept callback", pcb->state == LISTEN); 1578 lpcb = (struct tcp_pcb_listen *)pcb; 1579 1580 lpcb->accept = accept; 1581 lpcb->accept_on_syn = 1; 1561 1582 } 1562 1583 #endif /* LWIP_CONNECTION_PROXY */ -
trunk/src/VBox/Devices/Network/lwip-new/src/core/tcp_in.c
r58549 r58555 569 569 &npcb->remote_ip, PCB_ISIPV6(npcb)); 570 570 #endif /* TCP_CALCULATE_EFF_SEND_MSS */ 571 572 573 #if LWIP_CONNECTION_PROXY 574 /* Early accept on SYN, like we do in tcp_proxy_listen_input() */ 575 if (pcb->accept_on_syn) { 576 err_t err; 577 578 /* back off to "delayed" SYN_RCVD, see comments in proxy */ 579 npcb->state = SYN_RCVD_0; 580 581 /* 582 * XXX: TODO: how to pass syn pbuf? Need to be consistent with 583 * proxy version, but can't abuse callback_arg here since it's 584 * actually used in this case. 585 */ 586 /* Call the accept function. */ 587 TCP_EVENT_ACCEPT(npcb, ERR_OK, err); 588 if (err != ERR_OK) { 589 /* If the accept function returns with an error, we abort 590 * the connection. */ 591 /* Already aborted? */ 592 if (err != ERR_ABRT) { 593 tcp_abort(npcb); 594 } 595 return ERR_ABRT; 596 } 597 /* Don't send SYN|ACK now, client will call 598 * tcp_proxy_accept_confirm(). */ 599 return ERR_OK; 600 } 601 #endif 571 602 572 603 snmp_inc_tcppassiveopens(); -
trunk/src/VBox/Devices/Network/lwip-new/src/include/lwip/tcp.h
r47886 r58555 301 301 u8_t accept_any_ip_version; 302 302 #endif /* LWIP_IPV6 */ 303 #if LWIP_CONNECTION_PROXY 304 u8_t accept_on_syn; 305 #endif 303 306 }; 304 307 … … 331 334 void tcp_proxy_arg(void *arg); 332 335 void tcp_proxy_accept(tcp_accept_fn accept); 336 /* but we also provide proxy-like early accept for listening pcbs */ 337 void tcp_accept_syn(struct tcp_pcb *lpcb, tcp_accept_fn accept); 333 338 #endif 334 339 void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv);
Note:
See TracChangeset
for help on using the changeset viewer.