VirtualBox

Changeset 30051 in vbox for trunk


Ignore:
Timestamp:
Jun 7, 2010 7:29:48 AM (15 years ago)
Author:
vboxsync
Message:

#4814: vboxnetflt qdisc: Older kernel fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c

    r30029 r30051  
    182182
    183183#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
     184#define qdisc_pkt_len(skb) (skb->len)
    184185#define QDISC_GET(dev) (dev->qdisc_sleeping)
    185186#else
     
    336337}
    337338
     339#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
     340static int vboxNetFltQdiscRequeue(struct sk_buff *skb, struct Qdisc *sch)
     341{
     342    int rc;
     343    PVBOXNETQDISCPRIV pPriv = qdisc_priv(sch);
     344
     345    rc = pPriv->pChild->ops->requeue(skb, pPriv->pChild);
     346    if (rc == 0)
     347    {
     348        sch->q.qlen++;
     349        sch->qstats.requeues++;
     350    }
     351
     352    return rc;
     353}
     354#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
     355
    338356static unsigned int vboxNetFltQdiscDrop(struct Qdisc *sch)
    339357{
     
    413431    *ppOld = pPriv->pChild;
    414432    pPriv->pChild = pNew;
     433#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
    415434    qdisc_tree_decrease_qlen(*ppOld, (*ppOld)->q.qlen);
     435#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) */
     436    sch->q.qlen = 0;
     437#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) */
    416438    qdisc_reset(*ppOld);
    417439    sch_tree_unlock(sch);
     
    498520    .enqueue   = vboxNetFltQdiscEnqueue,
    499521    .dequeue   = vboxNetFltQdiscDequeue,
     522#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
     523    .requeue   = vboxNetFltQdiscRequeue,
     524#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
    500525    .peek      = qdisc_peek_dequeued,
     526#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
    501527    .drop      = vboxNetFltQdiscDrop,
    502528    .init      = vboxNetFltQdiscInit,
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