VirtualBox

Changeset 14390 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Nov 20, 2008 10:09:55 AM (16 years ago)
Author:
vboxsync
Message:

check sum calculation was fixed

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

Legend:

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

    r14265 r14390  
    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 */
    4846#endif
    4947
  • trunk/src/VBox/Devices/Network/slirp/ip_input.c

    r14287 r14390  
    220220        else
    221221                ip->ip_len -= hlen;
    222 #endif /* !VBOX_WITH_BSD_REASS */
     222#endif /* VBOX_WITH_BSD_REASS */
    223223
    224224        /*
     
    514514     */
    515515    ipstat.ips_fragments++;
    516     m->m_data = (caddr_t)ip;
     516    m->m_hdr.header = ip;
    517517
    518518    /* Previous ip_reass() started here. */
     
    521521     * would confuse code below.
    522522     */
    523 #if 0
    524523    m->m_data += hlen;
    525524    m->m_len -= hlen;
    526 #endif
    527525
    528526    /*
     
    548546    }
    549547
    550 #define GETIP(m)    ((struct ip*)((m)->m_data))
     548#define GETIP(m)    ((struct ip*)((m)->m_hdr.header))
    551549
    552550
     
    666664     * Make header visible.
    667665     */
     666#if 0
    668667    ip->ip_len = (ip->ip_hl << 2) + next;
     668#else
     669    ip->ip_len = next;
     670#endif
    669671    ip->ip_src = fp->ipq_src;
    670672    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 */
    675673    TAILQ_REMOVE(head, fp, ipq_list);
    676674    nipq--;
    677675    free(fp);
    678676
    679 #if 0
    680677    m->m_len += (ip->ip_hl << 2);
    681678    m->m_data -= (ip->ip_hl << 2);
    682 #endif
    683679    /* some debugging cruft by sklower, below, will go away soon */
    684680#if 0
  • trunk/src/VBox/Devices/Network/slirp/mbuf.h

    r14252 r14390  
    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 */
     75#ifdef VBOX_WITH_BSD_REASS
     76        void *header;                   /*XXX: in real BSD sources this field lays in pkthdr structure*/
     77#endif
    7878};
    7979
     
    111111#define m_ext           M_dat.m_ext_
    112112#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 */
    116113
    117114#define ifq_prev m_prev
  • trunk/src/VBox/Devices/Network/slirp/tcp_input.c

    r14329 r14390  
    479479         * ti->ti_sum = cksum(m, len);
    480480         * if (ti->ti_sum) { */
    481 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK
    482         if (m->m_sum_recalculate == 0 && ip->ip_sum != 0) {
    483 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */
    484481        if(cksum(m, len)) {
    485482          tcpstat.tcps_rcvbadsum++;
    486483          goto drop;
    487484        }
    488 #ifdef VBOX_WITH_BSD_REASS_CKSUM_HACK
    489         }
    490 #endif /* VBOX_WITH_BSD_REASS_CKSUM_HACK */
    491485
    492486        /*
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r14252 r14390  
    122122         * Checksum extended UDP header and data.
    123123         */
    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) {
    130125          ((struct ipovly *)ip)->ih_next = 0;
    131126          ((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