~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/Devices/Network/slirp/ip_input.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-10-13 23:06:00 UTC
  • mfrom: (0.3.2 upstream) (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20091013230600-xhu2pwizq0wo63l9
Tags: 3.0.8-dfsg-1ubuntu1
* Merge from debian unstable (LP: #444812), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
* Try to remove existing dkms modules before adding the new modules
  (LP: #434503)
  - debian/virtualbox-ose-source.postinst
  - debian/virtualbox-ose-guest-source.postinst
* Don't fail if dkms modules have already been removed
  - debian/virtualbox-ose-source.prerm
  - debian/virtualbox-ose-guest-source.prerm

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
#ifdef VBOX_WITH_SLIRP_ALIAS
88
88
    {
89
89
        int rc;
90
 
        rc = LibAliasIn(m->m_la ? m->m_la : pData->proxy_alias, mtod(m, char *), 
 
90
        rc = LibAliasIn(m->m_la ? m->m_la : pData->proxy_alias, mtod(m, char *),
91
91
            m->m_len);
92
92
        Log2(("NAT: LibAlias return %d\n", rc));
93
93
    }
175
175
        if (m == NULL)
176
176
            return;
177
177
        ip = mtod(m, struct ip *);
178
 
        hlen = ip->ip_len;
 
178
        hlen = ip->ip_hl << 2;
179
179
    }
180
180
    else
181
181
        ip->ip_len -= hlen;
201
201
    }
202
202
    return;
203
203
bad:
204
 
    Log2(("NAT: IP datagram to %R[IP4] with size(%d) claimed as bad\n", 
 
204
    Log2(("NAT: IP datagram to %R[IP4] with size(%d) claimed as bad\n",
205
205
        &ip->ip_dst, ip->ip_len));
206
206
    m_freem(pData, m);
207
207
    return;
442
442
     */
443
443
    q = fp->ipq_frags;
444
444
    ip = GETIP(q);
445
 
    if (next + (ip->ip_hl << 2) > IP_MAXPACKET)
 
445
    hlen = ip->ip_hl << 2;
 
446
    if (next + hlen > IP_MAXPACKET)
446
447
    {
447
448
        ipstat.ips_fragdropped += fp->ipq_nfrags;
448
449
        ip_freef(pData, head, fp);
460
461
        nq = q->m_nextpkt;
461
462
        q->m_nextpkt = NULL;
462
463
        m_cat(pData, m, q);
 
464
 
 
465
        m->m_len += hlen;
 
466
        m->m_data -= hlen;
 
467
        ip = mtod(m, struct ip *); /*update ip pointer */
 
468
        hlen = ip->ip_hl << 2;
 
469
        m->m_len -= hlen;
 
470
        m->m_data += hlen;
463
471
    }
 
472
    m->m_len += hlen;
 
473
    m->m_data -= hlen;
464
474
 
465
475
    /*
466
476
     * Create header for new ip packet by modifying header of first
467
477
     * packet;  dequeue and discard fragment reassembly header.
468
478
     * Make header visible.
469
479
     */
470
 
#if 0
471
 
    ip->ip_len = (ip->ip_hl << 2) + next;
472
 
#else
 
480
 
473
481
    ip->ip_len = next;
474
 
#endif
475
482
    ip->ip_src = fp->ipq_src;
476
483
    ip->ip_dst = fp->ipq_dst;
477
484
    TAILQ_REMOVE(head, fp, ipq_list);
478
485
    nipq--;
479
486
    RTMemFree(fp);
480
487
 
481
 
    m->m_len += (ip->ip_hl << 2);
482
 
    m->m_data -= (ip->ip_hl << 2);
 
488
    Assert((ip->ip_len == next));
483
489
    /* some debugging cruft by sklower, below, will go away soon */
484
490
#if 0
485
491
    if (m->m_flags & M_PKTHDR)    /* XXX this should be done elsewhere */
539
545
 
540
546
            fpp = fp;
541
547
            fp = TAILQ_NEXT(fp, ipq_list);
542
 
            if(--fpp->ipq_ttl == 0)
 
548
            if (--fpp->ipq_ttl == 0)
543
549
            {
544
550
                ipstat.ips_fragtimeout += fpp->ipq_nfrags;
545
551
                ip_freef(pData, &ipq[i], fpp);