VirtualBox

Changeset 14252 in vbox


Ignore:
Timestamp:
Nov 17, 2008 12:47:05 PM (16 years ago)
Author:
vboxsync
Message:

csum validation hack, for testing IP integration of fragmentation routines borrowed from BSD

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/ip.h

    r14232 r14252  
    4444/* XXX: Windows has own queue types declared in winnt.h (should look at them once again) */
    4545# endif
     46#define VBOX_WITH_BSD_REASS_CKSUM_HACK
     47/* XXX: Don't forget to import BSD routines csum validation of reassembled packet */
    4648#endif
    4749
  • trunk/src/VBox/Devices/Network/slirp/ip_input.c

    r14243 r14252  
    669669    ip->ip_src = fp->ipq_src;
    670670    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 */
    671675    TAILQ_REMOVE(head, fp, ipq_list);
    672676    nipq--;
  • trunk/src/VBox/Devices/Network/slirp/mbuf.h

    r14232 r14252  
    7373        caddr_t mh_data;                /* Location of data */
    7474        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 */
    7578};
    7679
     
    108111#define m_ext           M_dat.m_ext_
    109112#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 */
    110116
    111117#define ifq_prev m_prev
  • trunk/src/VBox/Devices/Network/slirp/tcp_input.c

    r14180 r14252  
    297297         * ti->ti_sum = cksum(m, len);
    298298         * 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 */
    299302        if(cksum(m, len)) {
    300303          tcpstat.tcps_rcvbadsum++;
    301304          goto drop;
    302305        }
     306#ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK
     307        }
     308#endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */
    303309
    304310        /*
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r14180 r14252  
    122122         * Checksum extended UDP header and data.
    123123         */
    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            ) {
    125130          ((struct ipovly *)ip)->ih_next = 0;
    126131          ((struct ipovly *)ip)->ih_prev = 0;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette