Changeset 14390 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 20, 2008 10:09:55 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip.h
r14265 r14390 44 44 /* XXX: Windows has own queue types declared in winnt.h (should look at them once again) */ 45 45 # endif 46 #define VBOX_WITH_BSD_REASS_CKSUM_HACK47 /* XXX: Don't forget to import BSD routines csum validation of reassembled packet */48 46 #endif 49 47 -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r14287 r14390 220 220 else 221 221 ip->ip_len -= hlen; 222 #endif /* !VBOX_WITH_BSD_REASS */222 #endif /* VBOX_WITH_BSD_REASS */ 223 223 224 224 /* … … 514 514 */ 515 515 ipstat.ips_fragments++; 516 m->m_ data = (caddr_t)ip;516 m->m_hdr.header = ip; 517 517 518 518 /* Previous ip_reass() started here. */ … … 521 521 * would confuse code below. 522 522 */ 523 #if 0524 523 m->m_data += hlen; 525 524 m->m_len -= hlen; 526 #endif527 525 528 526 /* … … 548 546 } 549 547 550 #define GETIP(m) ((struct ip*)((m)->m_ data))548 #define GETIP(m) ((struct ip*)((m)->m_hdr.header)) 551 549 552 550 … … 666 664 * Make header visible. 667 665 */ 666 #if 0 668 667 ip->ip_len = (ip->ip_hl << 2) + next; 668 #else 669 ip->ip_len = next; 670 #endif 669 671 ip->ip_src = fp->ipq_src; 670 672 ip->ip_dst = fp->ipq_dst; 671 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK672 ip->ip_sum = 0;673 m->m_sum_recalculate = 1;674 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */675 673 TAILQ_REMOVE(head, fp, ipq_list); 676 674 nipq--; 677 675 free(fp); 678 676 679 #if 0680 677 m->m_len += (ip->ip_hl << 2); 681 678 m->m_data -= (ip->ip_hl << 2); 682 #endif683 679 /* some debugging cruft by sklower, below, will go away soon */ 684 680 #if 0 -
trunk/src/VBox/Devices/Network/slirp/mbuf.h
r14252 r14390 73 73 caddr_t mh_data; /* Location of data */ 74 74 int mh_len; /* Amount of data in this mbuf */ 75 #ifdef VBOX_WITH_BSD_REASS _CKSUM_HACK76 int mh_sum_recalculate;77 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */75 #ifdef VBOX_WITH_BSD_REASS 76 void *header; /*XXX: in real BSD sources this field lays in pkthdr structure*/ 77 #endif 78 78 }; 79 79 … … 111 111 #define m_ext M_dat.m_ext_ 112 112 #define m_so m_hdr.mh_so 113 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK114 #define m_sum_recalculate m_hdr.mh_sum_recalculate115 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */116 113 117 114 #define ifq_prev m_prev -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r14329 r14390 479 479 * ti->ti_sum = cksum(m, len); 480 480 * if (ti->ti_sum) { */ 481 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK482 if (m->m_sum_recalculate == 0 && ip->ip_sum != 0) {483 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */484 481 if(cksum(m, len)) { 485 482 tcpstat.tcps_rcvbadsum++; 486 483 goto drop; 487 484 } 488 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK489 }490 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */491 485 492 486 /* -
trunk/src/VBox/Devices/Network/slirp/udp.c
r14252 r14390 122 122 * Checksum extended UDP header and data. 123 123 */ 124 if (udpcksum && uh->uh_sum 125 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK 126 /*XXX: hack over csum calculation */ 127 && (m->m_sum_recalculate == 0 && ip->ip_sum != 0) 128 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */ 129 ) { 124 if (udpcksum && uh->uh_sum) { 130 125 ((struct ipovly *)ip)->ih_next = 0; 131 126 ((struct ipovly *)ip)->ih_prev = 0;
Note:
See TracChangeset
for help on using the changeset viewer.