Changeset 58589 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Nov 5, 2015 4:00:52 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103947
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/lwip-new/src/core/tcp_in.c
r58581 r58589 95 95 #if LWIP_CONNECTION_PROXY 96 96 static err_t tcp_proxy_listen_input(struct pbuf *p); 97 static void tcp_restore_pbuf(struct pbuf *p); 97 98 98 99 void … … 255 256 * create ICMP datagram. 256 257 */ 257 pbuf_header(p, ip_current_header_tot_len() + hdrlen * 4);258 258 tcp_proxy_listen_input(p); 259 259 pbuf_free(p); … … 613 613 614 614 #if LWIP_CONNECTION_PROXY 615 /* 616 * Proxy accept callback will be passed the pbuf with the SYN segment 617 * so that it can use it for ICMP errors if necessary. Undo changes 618 * we've done to the pbuf so that it's suitable to be passed to 619 * icmp_send_response(). 620 */ 621 static void 622 tcp_restore_pbuf(struct pbuf *p) 623 { 624 u8_t hdrlen = TCPH_HDRLEN(tcphdr); 625 626 /* Reveal IP and TCP headers. */ 627 pbuf_header(p, ip_current_header_tot_len() + hdrlen * 4); 628 629 /* Convert fields in the TCP header back to network byte order. */ 630 tcphdr->src = htons(tcphdr->src); 631 tcphdr->dest = htons(tcphdr->dest); 632 tcphdr->seqno = htonl(tcphdr->seqno); 633 tcphdr->ackno = htonl(tcphdr->ackno); 634 tcphdr->wnd = htons(tcphdr->wnd); 635 } 636 637 615 638 /** 616 639 * We run proxied packets through tcp_input() since it mostly does … … 707 730 * For the proxy to be able to create ICMP unreachable datagram we 708 731 * need to keep the beginning of the pbuf around. We pass is as 709 * callback arg here and let callback decide. Payload is already 710 * moved back to the IP header by the caller. 732 * callback arg here and let callback decide. 711 733 */ 712 734 713 /* 714 * Convert fields in the TCP header back to network byte order 715 * (for ICMP). I think it's safe to do now, as tcphdr will not be 716 * accessed after this. 717 */ 718 tcphdr->src = htons(tcphdr->src); 719 tcphdr->dest = htons(tcphdr->dest); 720 tcphdr->seqno = htonl(tcphdr->seqno); 721 tcphdr->ackno = htonl(tcphdr->ackno); 722 tcphdr->wnd = htons(tcphdr->wnd); 723 735 tcp_restore_pbuf(p); 724 736 npcb->callback_arg = (void *)p; 725 737
Note:
See TracChangeset
for help on using the changeset viewer.