1 |
wolf31o2 08/02/02 14:15:40 |
2 |
|
3 |
Added: 2.6.24.patch |
4 |
Log: |
5 |
Added a patch for 2.6.24 support. Closing bug #207536. |
6 |
(Portage version: 2.1.4.1) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 net-misc/cisco-vpnclient-3des/files/2.6.24.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/cisco-vpnclient-3des/files/2.6.24.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/cisco-vpnclient-3des/files/2.6.24.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: 2.6.24.patch |
15 |
=================================================================== |
16 |
diff -Nur vpnclient/GenDefs.h vpnclient.new/GenDefs.h |
17 |
--- vpnclient/GenDefs.h 2007-08-22 21:30:31.000000000 +0200 |
18 |
+++ vpnclient.new/GenDefs.h 2008-01-25 08:56:46.000000000 +0100 |
19 |
@@ -105,6 +105,12 @@ |
20 |
#define _INTPTR_T_DEFINED |
21 |
#endif |
22 |
|
23 |
+/* uintptr_t has been defined in include/linux/types.h in 2.6.24. |
24 |
+ * No need to define it here again (will only lead to compile errors) |
25 |
+ * |
26 |
+ * by Alexander Griesser <work@×××××××××.at>, 2008-01-11 |
27 |
+ */ |
28 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) |
29 |
#ifndef _UINTPTR_T_DEFINED |
30 |
#if defined(_LP64) |
31 |
#warning 64 bit |
32 |
@@ -114,6 +120,7 @@ |
33 |
#endif |
34 |
#define _UINTPTR_T_DEFINED |
35 |
#endif |
36 |
+#endif |
37 |
|
38 |
|
39 |
typedef int BOOL; |
40 |
diff -Nur vpnclient/interceptor.c vpnclient.new/interceptor.c |
41 |
--- vpnclient/interceptor.c 2007-08-22 21:30:31.000000000 +0200 |
42 |
+++ vpnclient.new/interceptor.c 2008-01-25 09:50:52.000000000 +0100 |
43 |
@@ -28,6 +28,10 @@ |
44 |
#include <linux/udp.h> |
45 |
#include <net/protocol.h> |
46 |
|
47 |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) |
48 |
+#include <net/net_namespace.h> |
49 |
+#endif |
50 |
+ |
51 |
#include "linux_os.h" |
52 |
|
53 |
#include "vpn_ioctl_linux.h" |
54 |
@@ -48,7 +52,7 @@ |
55 |
unsigned long rx_bytes; |
56 |
|
57 |
/*methods of the cipsec network device*/ |
58 |
-static int interceptor_init(struct net_device *); |
59 |
+static void interceptor_init(struct net_device *); |
60 |
static struct net_device_stats *interceptor_stats(struct net_device *dev); |
61 |
static int interceptor_ioctl(struct net_device *dev, struct ifreq *ifr, |
62 |
int cmd); |
63 |
@@ -107,18 +111,27 @@ |
64 |
|
65 |
BINDING Bindings[MAX_INTERFACES]; |
66 |
|
67 |
+/* 2.6.24 handles net_devices a little bit different |
68 |
+ * |
69 |
+ * by Alexander Griesser <work@×××××××××.at>, 2008-01-11 |
70 |
+ */ |
71 |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) |
72 |
+static struct net_device* interceptor_dev; |
73 |
+#else |
74 |
static struct net_device interceptor_dev = { |
75 |
.name = interceptor_name, |
76 |
.init = interceptor_init |
77 |
}; |
78 |
+#endif |
79 |
+ |
80 |
static struct notifier_block interceptor_notifier = { |
81 |
.notifier_call = handle_netdev_event, |
82 |
}; |
83 |
|
84 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) |
85 |
-static int |
86 |
+static void |
87 |
#else |
88 |
-static int __init |
89 |
+static void __init |
90 |
#endif |
91 |
interceptor_init(struct net_device *dev) |
92 |
{ |
93 |
@@ -133,8 +146,6 @@ |
94 |
dev->flags |= IFF_NOARP; |
95 |
dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); |
96 |
kernel_memset(dev->broadcast, 0xFF, ETH_ALEN); |
97 |
- |
98 |
- return 0; |
99 |
} |
100 |
|
101 |
static struct net_device_stats * |
102 |
@@ -362,8 +373,13 @@ |
103 |
|
104 |
dp = NULL; |
105 |
num_target_devices = 0; |
106 |
+ |
107 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) |
108 |
- for_each_netdev(dp) |
109 |
+ for_each_netdev( |
110 |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) |
111 |
+ &init_net, |
112 |
+#endif |
113 |
+ dp) |
114 |
#else |
115 |
for (dp = dev_base; dp != NULL; dp = dp->next) |
116 |
#endif |
117 |
@@ -919,15 +935,29 @@ |
118 |
|
119 |
rc = CniPluginLoad(&pcDeviceName, &PCNICallbackTable); |
120 |
|
121 |
+/* 2.6.24 needs to allocate each netdevice before registering it, otherwise |
122 |
+ * the kernel BUG()s. |
123 |
+ * |
124 |
+ * by Alexander Griesser <work@×××××××××.at>, 2008-01-11 |
125 |
+ */ |
126 |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) |
127 |
+ if(! (interceptor_dev = alloc_netdev(sizeof(struct net_device), interceptor_name, interceptor_init))) |
128 |
+ return 0; |
129 |
+#endif |
130 |
+ |
131 |
if (CNI_IS_SUCCESS(rc)) |
132 |
{ |
133 |
|
134 |
CNICallbackTable = *PCNICallbackTable; |
135 |
CniPluginDeviceCreated(); |
136 |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) |
137 |
+ if ((status = register_netdev(interceptor_dev)) != 0) |
138 |
+#else |
139 |
if ((status = register_netdev(&interceptor_dev)) != 0) |
140 |
+#endif |
141 |
{ |
142 |
printk(KERN_INFO "%s: error %d registering device \"%s\".\n", |
143 |
- LINUX_VPN_IFNAME, status, interceptor_dev.name); |
144 |
+ LINUX_VPN_IFNAME, status, interceptor_name); |
145 |
CniPluginUnload(); |
146 |
|
147 |
} |
148 |
@@ -947,7 +977,11 @@ |
149 |
cleanup_frag_queue(); |
150 |
CniPluginUnload(); |
151 |
|
152 |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) |
153 |
+ unregister_netdev(interceptor_dev); |
154 |
+#else |
155 |
unregister_netdev(&interceptor_dev); |
156 |
+#endif |
157 |
unregister_netdevice_notifier(&interceptor_notifier); |
158 |
|
159 |
return; |
160 |
|
161 |
|
162 |
|
163 |
-- |
164 |
gentoo-commits@l.g.o mailing list |