]> git.pld-linux.org Git - packages/kernel.git/blame - 2.6.7-ppc-proxydict-workaround.patch
- merged with 2.6.7-ppc-proxydict-workaround.patch.
[packages/kernel.git] / 2.6.7-ppc-proxydict-workaround.patch
CommitLineData
23830b13
PS
1--- linux-2.6.7/net/sched/proxydict.c.orig 2004-07-06 22:03:48.000000000 +0200
2+++ linux-2.6.7/net/sched/proxydict.c 2004-07-07 01:20:29.238093104 +0200
3@@ -18,7 +18,7 @@
4 // Size of hash table given maximal number of connections:
5 #define hash_size_max_con(max_con) (2*(max_con))
6
7-// The memory area we maintain:
8+// The __proxydict_memory area we maintain:
9 typedef struct {
10 int hash_size;
11 int max_con;
12@@ -38,20 +38,20 @@
13 //
14 // The entries in next not allocated is also in linked list where
15 // the first free index is free_first.
16-} memory;
17+} __proxydict_memory;
18
19-#define Memory(m) ((memory*)m)
20-#define Hash_table(m) ((int*)(((char*)m)+sizeof(memory)))
21-#define Next(m) ((int*)(((char*)m)+sizeof(memory)+ \
22- sizeof(int)*((memory*)m)->hash_size))
23+#define Memory(m) ((__proxydict_memory*)m)
24+#define Hash_table(m) ((int*)(((char*)m)+sizeof(__proxydict_memory)))
25+#define Next(m) ((int*)(((char*)m)+sizeof(__proxydict_memory)+ \
26+ sizeof(int)*((__proxydict_memory*)m)->hash_size))
27 #define Info(m) ((ProxyRemapBlock*)(((char*)m)+ \
28- sizeof(memory)+ \
29- sizeof(int)*((memory*)m)->hash_size+\
30- sizeof(int)*((memory*)m)->max_con \
31+ sizeof(__proxydict_memory)+ \
32+ sizeof(int)*((__proxydict_memory*)m)->hash_size+\
33+ sizeof(int)*((__proxydict_memory*)m)->max_con \
34 ))
35
36 int proxyGetMemSize(int max_con) {
37- return sizeof(memory)+
38+ return sizeof(__proxydict_memory)+
39 sizeof(int)*hash_size_max_con(max_con)+
40 sizeof(int)*max_con+
41 sizeof(ProxyRemapBlock)*max_con;
42@@ -59,7 +59,7 @@
43
44 void proxyInitMem(void* data, int max_con) {
45 // Init m:
46- memory* m=Memory(data);
47+ __proxydict_memory* m=Memory(data);
48 m->max_con=max_con;
49 m->cur_con=0;
50 m->hash_size=hash_size_max_con(max_con);
51@@ -88,7 +88,7 @@
52 }
53
54 ProxyRemapBlock* proxyLookup(void* data, unsigned ipaddr, unsigned short port, char proto) {
55- memory* m=Memory(data);
56+ __proxydict_memory* m=Memory(data);
57 int* hash_table=Hash_table(m);
58 int* next=Next(m);
59 ProxyRemapBlock* info=Info(m);
60@@ -104,7 +104,7 @@
61 }
62
63 int proxyConsumeBlock(void* data, ProxyRemapBlock* blk) {
64- memory* m=Memory(data);
65+ __proxydict_memory* m=Memory(data);
66 int* hash_table=Hash_table(m);
67 int* next=Next(m);
68 ProxyRemapBlock* info=Info(m);
This page took 0.056234 seconds and 4 git commands to generate.