~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Devices/Network/slirp/libalias/alias.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1665
1665
 
1666
1666
#endif
1667
1667
 
1668
 
#ifdef _KERNEL
 
1668
#if defined(_KERNEL) || (defined(VBOX) && defined(VBOX_WITH_SLIRP_BSD_MBUF))
1669
1669
/*
1670
1670
 * m_megapullup() - this function is a big hack.
1671
1671
 * Thankfully, it's only used in ng_nat and ipfw+nat.
1679
1679
 * the input packet, on failure NULL. The input packet is always consumed.
1680
1680
 */
1681
1681
struct mbuf *
1682
 
m_megapullup(struct mbuf *m, int len) {
 
1682
#ifndef VBOX
 
1683
m_megapullup(struct mbuf *m, int len) 
 
1684
#else
 
1685
m_megapullup(PNATState pData, struct mbuf *m, int len)
 
1686
#endif
 
1687
{
1683
1688
    struct mbuf *mcl;
1684
1689
    
1685
1690
    if (len > m->m_pkthdr.len)
1693
1698
        return (m);
1694
1699
 
1695
1700
    if (len <= MCLBYTES - RESERVE) {
 
1701
#ifndef VBOX
1696
1702
        mcl = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
 
1703
#else
 
1704
        mcl = m_getcl(pData, M_DONTWAIT, MT_DATA, M_PKTHDR);
 
1705
#endif
1697
1706
    } else if (len < MJUM16BYTES) {
1698
1707
        int size;
1699
1708
        if (len <= MJUMPAGESIZE - RESERVE) {
1703
1712
        } else {
1704
1713
            size = MJUM16BYTES;
1705
1714
        };
 
1715
#ifndef VBOX
1706
1716
        mcl = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
 
1717
#else
 
1718
        mcl = m_getjcl(pData, M_DONTWAIT, MT_DATA, M_PKTHDR, size);
 
1719
#endif
1707
1720
    } else {
1708
1721
        goto bad;
1709
1722
    }
1713
1726
    m_move_pkthdr(mcl, m);
1714
1727
    m_copydata(m, 0, len, mtod(mcl, caddr_t));
1715
1728
    mcl->m_len = mcl->m_pkthdr.len = len;
 
1729
#ifndef VBOX
1716
1730
    m_freem(m);
 
1731
#else
 
1732
    m_freem(pData, m);
 
1733
#endif
1717
1734
 
1718
1735
    return (mcl);
1719
1736
bad:
 
1737
#ifndef VBOX
1720
1738
    m_freem(m);
 
1739
#else
 
1740
    m_freem(pData, m);
 
1741
#endif
1721
1742
    return (NULL);
1722
1743
}
1723
1744
#endif