Changeset 14252 in vbox
- Timestamp:
- Nov 17, 2008 12:47:05 PM (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
r14232 r14252 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_HACK 47 /* XXX: Don't forget to import BSD routines csum validation of reassembled packet */ 46 48 #endif 47 49 -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r14243 r14252 669 669 ip->ip_src = fp->ipq_src; 670 670 ip->ip_dst = fp->ipq_dst; 671 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK 672 ip->ip_sum = 0; 673 m->m_sum_recalculate = 1; 674 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */ 671 675 TAILQ_REMOVE(head, fp, ipq_list); 672 676 nipq--; -
trunk/src/VBox/Devices/Network/slirp/mbuf.h
r14232 r14252 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_HACK 76 int mh_sum_recalculate; 77 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */ 75 78 }; 76 79 … … 108 111 #define m_ext M_dat.m_ext_ 109 112 #define m_so m_hdr.mh_so 113 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK 114 #define m_sum_recalculate m_hdr.mh_sum_recalculate 115 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */ 110 116 111 117 #define ifq_prev m_prev -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r14180 r14252 297 297 * ti->ti_sum = cksum(m, len); 298 298 * if (ti->ti_sum) { */ 299 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK 300 if (m->m_sum_recalculate == 0 && ip->ip_sum != 0) { 301 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */ 299 302 if(cksum(m, len)) { 300 303 tcpstat.tcps_rcvbadsum++; 301 304 goto drop; 302 305 } 306 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK 307 } 308 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */ 303 309 304 310 /* -
trunk/src/VBox/Devices/Network/slirp/udp.c
r14180 r14252 122 122 * Checksum extended UDP header and data. 123 123 */ 124 if (udpcksum && uh->uh_sum) { 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 ) { 125 130 ((struct ipovly *)ip)->ih_next = 0; 126 131 ((struct ipovly *)ip)->ih_prev = 0;
Note:
See TracChangeset
for help on using the changeset viewer.