Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 234361 | Differences between
and this patch

Collapse All | Expand All

(-)vpnclient-orig/linuxcniapi.c (-6 / +23 lines)
Lines 338-345 Link Here
338
    skb->ip_summed = CHECKSUM_UNNECESSARY;
338
    skb->ip_summed = CHECKSUM_UNNECESSARY;
339
339
340
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
340
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
341
    skb->network_header = (sk_buff_data_t) skb->data;
341
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
342
    skb->mac_header = (sk_buff_data_t)pMac;
342
 * We have to use (pMac - skb->data) to get an offset.
343
 * We need to cast ptrs to byte ptrs and take the difference.
344
 */
345
    skb_reset_network_header(skb);
346
    skb_set_mac_header(skb, (int)((void *)pMac - (void *)skb->data));
343
#else
347
#else
344
    skb->nh.iph = (struct iphdr *) skb->data;
348
    skb->nh.iph = (struct iphdr *) skb->data;
345
    skb->mac.raw = pMac;
349
    skb->mac.raw = pMac;
Lines 478-485 Link Here
478
    skb->dev = pBinding->pDevice;
482
    skb->dev = pBinding->pDevice;
479
483
480
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
484
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
481
    skb->mac_header = (sk_buff_data_t)pMac;
485
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
482
    skb->network_header = (sk_buff_data_t)pIP;
486
 * We have to use (pIP/pMac - skb->data) to get an offset.
487
 * We need to cast ptrs to byte ptrs and take the difference.
488
 */
489
    skb_set_mac_header(skb, (int)((void *)pMac - (void *)skb->data));
490
    skb_set_network_header(skb, (int)((void *)pIP - (void *)skb->data));
483
#else
491
#else
484
    skb->mac.raw = pMac;
492
    skb->mac.raw = pMac;
485
    skb->nh.raw = pIP;
493
    skb->nh.raw = pIP;
Lines 487-494 Link Here
487
495
488
    /*ip header length is in 32bit words */
496
    /*ip header length is in 32bit words */
489
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
497
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
490
    skb->transport_header = (sk_buff_data_t)
498
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
491
      (pIP + (((struct iphdr*)(skb->network_header))->ihl * 4));
499
 * We have to use (pIP - skb->data) to get an offset.
500
 * We need to cast ptrs to byte ptrs and take the difference.
501
 */
502
    skb_set_transport_header(skb,
503
        ((int)((void *)pIP - (void *)skb->data) +
504
           (((struct iphdr*)(skb_network_header(skb)))->ihl * 4)));
492
#else
505
#else
493
    skb->h.raw = pIP + (skb->nh.iph->ihl * 4);
506
    skb->h.raw = pIP + (skb->nh.iph->ihl * 4);
494
#endif
507
#endif
Lines 496-502 Link Here
496
509
497
    /* send this packet up the NIC driver */
510
    /* send this packet up the NIC driver */
498
    // May need to call dev_queue_xmit(skb) instead
511
    // May need to call dev_queue_xmit(skb) instead
512
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
513
    tmp_rc = pBinding->Inject_ops->ndo_start_xmit(skb, skb->dev);
514
#else
499
    tmp_rc = pBinding->InjectSend(skb, skb->dev);
515
    tmp_rc = pBinding->InjectSend(skb, skb->dev);
516
#endif
500
517
501
#ifdef VIRTUAL_ADAPTER
518
#ifdef VIRTUAL_ADAPTER
502
    pVABinding = CniGetVABinding();
519
    pVABinding = CniGetVABinding();

Return to bug 234361