VirtualBox

Changeset 14616 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 26, 2008 4:20:08 AM (16 years ago)
Author:
vboxsync
Message:

ipovly now conform modern BSD making ih_x1 field as array overlapping ih_{next, prev}
fixing r39862 on 64-bit

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

Legend:

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

    r14567 r14616  
    203203
    204204#ifdef HAVE_SYS_TYPES32_H  /* Overcome some Solaris 2.x junk */
    205 #include <sys/types32.h>
    206 #else
    207 #if SIZEOF_CHAR_P == 4
     205# include <sys/types32.h>
     206#else
     207# if SIZEOF_CHAR_P == 4
    208208typedef caddr_t caddr32_t;
    209 #else
    210 #if !defined(VBOX_WITH_BSD_REASS) && !defined(VBOX_WITH_BSD_TCP_REASS)
     209# else
     210#  if !defined(VBOX_WITH_BSD_REASS) && !defined(VBOX_WITH_BSD_TCP_REASS)
    211211typedef u_int32_t caddr32_t;
    212 #else /* !VBOX_WITH_BSD_REASS && !VBOX_WITH_BSD_TCP_REASS*/
     212#  else /* !VBOX_WITH_BSD_REASS && !VBOX_WITH_BSD_TCP_REASS*/
    213213typedef caddr_t caddr32_t;
    214 #endif /* VBOX_WITH_BSD_REASS || VBOX_WITH_BSD_TCP_REASS*/
    215 #endif
     214#  endif /* VBOX_WITH_BSD_REASS || VBOX_WITH_BSD_TCP_REASS*/
     215# endif
    216216#endif
    217217
     
    228228 */
    229229struct ipovly {
     230#if !defined(VBOX_WITH_BSD_REASS) && !defined(VBOX_WITH_BSD_TCP_REASS)
    230231        caddr32_t       ih_next, ih_prev;       /* for protocol sequence q's */
    231232        u_int8_t        ih_x1;                  /* (unused) */
     233#else /* !VBOX_WITH_BSD_REASS && !VBOX_WITH_BSD_TCP_REASS */
     234        u_int8_t        ih_x1[9];                  /* (unused) */
     235#endif /* VBOX_WITH_BSD_REASS || VBOX_WITH_BSD_TCP_REASS */
    232236        u_int8_t        ih_pr;                  /* protocol */
    233237        u_int16_t       ih_len;                 /* protocol length */
  • trunk/src/VBox/Devices/Network/slirp/tcp_input.c

    r14577 r14616  
    470470         */
    471471        tlen = ((struct ip *)ti)->ip_len;
     472#if !defined(VBOX_WITH_BSD_REASS)
    472473        ti->ti_next = ti->ti_prev = 0;
    473474        ti->ti_x1 = 0;
     475#else
     476        memset(ti->ti_x1, 0, 9);
     477#endif
    474478        ti->ti_len = htons((u_int16_t)tlen);
    475479        len = sizeof(struct ip ) + tlen;
  • trunk/src/VBox/Devices/Network/slirp/tcp_subr.c

    r14522 r14616  
    7676        register struct tcpiphdr *n = &tp->t_template;
    7777
     78#if !defined(VBOX_WITH_BSD_REASS)
    7879        n->ti_next = n->ti_prev = 0;
    7980        n->ti_x1 = 0;
     81#else
     82        memset(n->ti_x1, 0, 9);
     83#endif
    8084        n->ti_pr = IPPROTO_TCP;
    8185        n->ti_len = htons(sizeof (struct tcpiphdr) - sizeof (struct ip));
     
    154158        m->m_len = tlen;
    155159
     160#if !defined(VBOX_WITH_BSD_REASS)
    156161        ti->ti_next = ti->ti_prev = 0;
    157162        ti->ti_x1 = 0;
     163#else
     164        memset(ti->ti_x1, 0, 9);
     165#endif
    158166        ti->ti_seq = htonl(seq);
    159167        ti->ti_ack = htonl(ack);
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r14470 r14616  
    123123         */
    124124        if (udpcksum && uh->uh_sum) {
     125#if !defined(VBOX_WITH_BSD_REASS)
    125126          ((struct ipovly *)ip)->ih_next = 0;
    126127          ((struct ipovly *)ip)->ih_prev = 0;
    127128          ((struct ipovly *)ip)->ih_x1 = 0;
     129#else
     130          memset(((struct ipovly *)ip)->ih_x1, 0, 9);
     131#endif
    128132          ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
    129133          /* keep uh_sum for ICMP reply
     
    265269         */
    266270        ui = mtod(m, struct udpiphdr *);
     271#if !defined(VBOX_WITH_BSD_REASS)
    267272        ui->ui_next = ui->ui_prev = 0;
    268273        ui->ui_x1 = 0;
     274#else
     275        memset(ui->ui_x1, 0, 9);
     276#endif
    269277        ui->ui_pr = IPPROTO_UDP;
    270278        ui->ui_len = htons(m->m_len - sizeof(struct ip)); /* + sizeof (struct udphdr)); */
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