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/Makefile (-1 / +3 lines)
Lines 12-18 Link Here
12
SOURCE_OBJS := linuxcniapi.o frag.o IPSecDrvOS_linux.o interceptor.o linuxkernelapi.o
12
SOURCE_OBJS := linuxcniapi.o frag.o IPSecDrvOS_linux.o interceptor.o linuxkernelapi.o
13
13
14
ifeq ($(SUBARCH),x86_64)
14
ifeq ($(SUBARCH),x86_64)
15
CFLAGS += -mcmodel=kernel -mno-red-zone
15
# Must NOT fiddle with CFLAGS
16
# CFLAGS += -mcmodel=kernel -mno-red-zone
17
EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone
16
NO_SOURCE_OBJS := libdriver64.so
18
NO_SOURCE_OBJS := libdriver64.so
17
else
19
else
18
NO_SOURCE_OBJS := libdriver.so
20
NO_SOURCE_OBJS := libdriver.so
(-)vpnclient.orig/frag.c (-1 / +3 lines)
Lines 22-28 Link Here
22
#include "frag.h"
22
#include "frag.h"
23
23
24
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
24
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
25
#define SKB_IPHDR(skb) ((struct iphdr*)skb->network_header)
25
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
26
 */
27
#define SKB_IPHDR(skb) ((struct iphdr*)skb_network_header)
26
#else
28
#else
27
#define SKB_IPHDR(skb) skb->nh.iph
29
#define SKB_IPHDR(skb) skb->nh.iph
28
#endif
30
#endif
(-)vpnclient.orig/interceptor.c (-4 / +19 lines)
Lines 637-655 Link Here
637
637
638
    reset_inject_status(&pBinding->recv_stat);
638
    reset_inject_status(&pBinding->recv_stat);
639
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
639
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
640
    if (skb->mac_header)
640
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
641
 */
642
    if (skb_mac_header_was_set(skb))
641
#else
643
#else
642
    if (skb->mac.raw)
644
    if (skb->mac.raw)
643
#endif
645
#endif
644
    {
646
    {
645
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
647
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
646
        hard_header_len = skb->data - skb->mac_header;
648
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
649
 */
650
        hard_header_len = skb->data - skb_mac_header(skb);
647
#else
651
#else
648
        hard_header_len = skb->data - skb->mac.raw;
652
        hard_header_len = skb->data - skb->mac.raw;
649
#endif
653
#endif
650
        if ((hard_header_len < 0) || (hard_header_len > skb_headroom(skb)))
654
        if ((hard_header_len < 0) || (hard_header_len > skb_headroom(skb)))
651
        {
655
        {
652
            printk(KERN_DEBUG "bad hh len %d\n", hard_header_len);
656
            printk(KERN_DEBUG "bad hh len %d\n", hard_header_len);
657
658
            printk(KERN_DEBUG "bad hh len %d, mac: %d, data: %p, head: %p\n",
659
                hard_header_len,
660
                skb->mac_header,    /* actualy ptr in 32-bit */
661
                skb->data,
662
                skb->head);
663
653
            hard_header_len = 0;
664
            hard_header_len = 0;
654
        }
665
        }
655
    }
666
    }
Lines 664-670 Link Here
664
    {
675
    {
665
    case ETH_HLEN:
676
    case ETH_HLEN:
666
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
677
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
667
        CniNewFragment(ETH_HLEN, skb->mac_header, &MacHdr, CNI_USE_BUFFER);
678
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
679
 */
680
        CniNewFragment(ETH_HLEN, skb_mac_header(skb), &MacHdr, CNI_USE_BUFFER);
668
#else
681
#else
669
        CniNewFragment(ETH_HLEN, skb->mac.raw, &MacHdr, CNI_USE_BUFFER);
682
        CniNewFragment(ETH_HLEN, skb->mac.raw, &MacHdr, CNI_USE_BUFFER);
670
#endif
683
#endif
Lines 782-788 Link Here
782
#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
795
#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
783
    reset_inject_status(&pBinding->send_stat);
796
    reset_inject_status(&pBinding->send_stat);
784
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
797
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
785
    hard_header_len = skb->network_header - skb->data;
798
/* 2.6.22 added an inline function for 32-/64-bit usage here, so use it.
799
 */
800
    hard_header_len = skb_network_header(skb) - skb->data;
786
#else
801
#else
787
    hard_header_len = skb->nh.raw - skb->data;
802
    hard_header_len = skb->nh.raw - skb->data;
788
#endif
803
#endif
(-)vpnclient.orig/linuxcniapi.c (-6 / +19 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
(-)vpnclient.orig/linuxkernelapi.c (-1 / +4 lines)
Lines 9-15 Link Here
9
    void*rc = kmalloc(size, GFP_ATOMIC);
9
    void*rc = kmalloc(size, GFP_ATOMIC);
10
    if(NULL == rc)
10
    if(NULL == rc)
11
    {
11
    {
12
        printk("<1> os_malloc size %d failed\n",size);
12
/* Allow for 32- or 64-bit size        
13
 *        printk("<1> os_malloc size %d failed\n",size);
14
 */
15
        printk("<1> os_malloc size %ld failed\n", (long)size);
13
    }
16
    }
14
17
15
    return rc;
18
    return rc;

Return to bug 234361