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

« back to all changes in this revision

Viewing changes to src/VBox/Devices/Network/DrvTAP.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: DrvTAP.cpp $ */
 
1
/* $Id: DrvTAP.cpp 35353 2010-12-27 17:25:52Z vboxsync $ */
2
2
/** @file
3
 
 * DrvTAP - Universial TAP network transport driver.
 
3
 * DrvTAP - Universal TAP network transport driver.
4
4
 */
5
5
 
6
6
/*
20
20
*******************************************************************************/
21
21
#define LOG_GROUP LOG_GROUP_DRV_TUN
22
22
#include <VBox/log.h>
23
 
#include <VBox/pdmdrv.h>
24
 
#include <VBox/pdmnetifs.h>
25
 
#include <VBox/pdmnetinline.h>
 
23
#include <VBox/vmm/pdmdrv.h>
 
24
#include <VBox/vmm/pdmnetifs.h>
 
25
#include <VBox/vmm/pdmnetinline.h>
26
26
 
27
27
#include <iprt/asm.h>
28
28
#include <iprt/assert.h>
72
72
# include <l4/vboxserver/file.h>
73
73
#endif
74
74
 
75
 
#include "Builtins.h"
 
75
#include "VBoxDD.h"
76
76
 
77
77
 
78
78
/*******************************************************************************
258
258
    Assert((pSgBuf->fFlags & PDMSCATTERGATHER_FLAGS_MAGIC_MASK) == PDMSCATTERGATHER_FLAGS_MAGIC);
259
259
    Assert(RTCritSectIsOwner(&pThis->XmitLock));
260
260
 
 
261
    /* Set an FTM checkpoint as this operation changes the state permanently. */
 
262
    PDMDrvHlpFTSetCheckpoint(pThis->pDrvIns, FTMCHECKPOINTTYPE_NETWORK);
 
263
 
261
264
    int rc;
262
265
    if (!pSgBuf->pvUser)
263
266
    {
279
282
        uint8_t const  *pbFrame = (uint8_t const *)pSgBuf->aSegs[0].pvSeg;
280
283
        PCPDMNETWORKGSO pGso    = (PCPDMNETWORKGSO)pSgBuf->pvUser;
281
284
        uint32_t const  cSegs   = PDMNetGsoCalcSegmentCount(pGso, pSgBuf->cbUsed);  Assert(cSegs > 1);
 
285
        rc = VINF_SUCCESS;
282
286
        for (size_t iSeg = 0; iSeg < cSegs; iSeg++)
283
287
        {
284
288
            uint32_t cbSegFrame;
416
420
 
417
421
                /*
418
422
                 * A return code != VINF_SUCCESS means that we were woken up during a VM
419
 
                 * state transistion. Drop the packet and wait for the next one.
 
423
                 * state transition. Drop the packet and wait for the next one.
420
424
                 */
421
425
                if (RT_FAILURE(rc1))
422
426
                    continue;
664
668
                        }
665
669
                        else
666
670
                            rc = PDMDrvHlpVMSetError(pThis->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,
667
 
                                                     N_("Failed to set appropriate promiscous mode"));
 
671
                                                     N_("Failed to set appropriate promiscuous mode"));
668
672
                    }
669
673
                    else
670
674
                        rc = PDMDrvHlpVMSetError(pThis->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,
671
 
                                                 N_("Failed to activate promiscous mode for VNIC"));
 
675
                                                 N_("Failed to activate promiscuous mode for VNIC"));
672
676
                }
673
677
                else
674
678
                    rc = PDMDrvHlpVMSetError(pThis->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,