patches/linux/2.4.26/100-kmap-types-cleanup.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
permissions -rw-r--r--
Configure tsocks with a simple heuristic.

Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.

So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.

If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).

/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
     1 From http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.2/att-1234/01-kmap-types-cleanup.patch
     2 See http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.2/1234.html
     3 
     4 From: Marc-Christian Petersen (m.c.p@wolk-project.de)
     5 
     6 > > on alpha:
     7 > > internal.h:19:28: asm/kmap_types.h: No such file or directory
     8 > Same on s390 and some other platforms.We should just get rid of
     9 > this problem by providing a generic kmap_types header.
    10 I agree on this but your patch is bogus. Please use the attached one instead.
    11 
    12 Marcello, please apply this one instead. Against 2.4.22-BK (2.4.21-bk14)
    13 
    14 [ I commented out the hunk
    15 #+++ b/include/asm-mips/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
    16 to get this to apply to linux-2.4.26. 
    17 - dank]
    18 
    19 diff -Naurp a/crypto/internal.h b/crypto/internal.h
    20 --- a/crypto/internal.h	2003-07-19 14:09:06.000000000 +0200
    21 +++ b/crypto/internal.h	2003-07-19 14:18:58.000000000 +0200
    22 @@ -14,9 +14,9 @@
    23  #include <linux/mm.h>
    24  #include <linux/highmem.h>
    25  #include <linux/init.h>
    26 +#include <linux/kmap_types.h>
    27  #include <asm/hardirq.h>
    28  #include <asm/softirq.h>
    29 -#include <asm/kmap_types.h>
    30  
    31  extern enum km_type crypto_km_types[];
    32  
    33 diff -Naurp a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
    34 --- a/include/asm-i386/fixmap.h	2003-07-19 14:09:31.000000000 +0200
    35 +++ b/include/asm-i386/fixmap.h	2003-07-19 14:18:58.000000000 +0200
    36 @@ -20,7 +20,7 @@
    37  #include <asm/page.h>
    38  #ifdef CONFIG_HIGHMEM
    39  #include <linux/threads.h>
    40 -#include <asm/kmap_types.h>
    41 +#include <linux/kmap_types.h>
    42  #endif
    43  
    44  /*
    45 diff -Naurp a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h
    46 --- a/include/asm-i386/highmem.h	2003-07-15 10:28:54.000000000 +0200
    47 +++ b/include/asm-i386/highmem.h	2003-07-19 14:18:58.000000000 +0200
    48 @@ -23,7 +23,6 @@
    49  #include <linux/config.h>
    50  #include <linux/init.h>
    51  #include <linux/interrupt.h>
    52 -#include <asm/kmap_types.h>
    53  #include <asm/pgtable.h>
    54  
    55  #ifdef CONFIG_DEBUG_HIGHMEM
    56 diff -Naurp a/include/asm-i386/kmap_types.h b/include/asm-i386/kmap_types.h
    57 --- a/include/asm-i386/kmap_types.h	2003-07-19 14:09:31.000000000 +0200
    58 +++ b/include/asm-i386/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
    59 @@ -1,16 +0,0 @@
    60 -#ifndef _ASM_KMAP_TYPES_H
    61 -#define _ASM_KMAP_TYPES_H
    62 -
    63 -enum km_type {
    64 -	KM_BOUNCE_READ,
    65 -	KM_SKB_SUNRPC_DATA,
    66 -	KM_SKB_DATA_SOFTIRQ,
    67 -	KM_USER0,
    68 -	KM_USER1,
    69 -	KM_BH_IRQ,
    70 -	KM_SOFTIRQ0,
    71 -	KM_SOFTIRQ1,
    72 -	KM_TYPE_NR
    73 -};
    74 -
    75 -#endif
    76 diff -Naurp a/include/asm-m68k/kmap_types.h b/include/asm-m68k/kmap_types.h
    77 --- a/include/asm-m68k/kmap_types.h	2003-07-19 14:09:33.000000000 +0200
    78 +++ b/include/asm-m68k/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
    79 @@ -1,18 +0,0 @@
    80 -#ifdef __KERNEL__
    81 -#ifndef _ASM_KMAP_TYPES_H
    82 -#define _ASM_KMAP_TYPES_H
    83 -
    84 -enum km_type {
    85 -	KM_BOUNCE_READ,
    86 -	KM_SKB_SUNRPC_DATA,
    87 -	KM_SKB_DATA_SOFTIRQ,
    88 -	KM_USER0,
    89 -	KM_USER1,
    90 -	KM_BH_IRQ,
    91 -	KM_SOFTIRQ0,
    92 -	KM_SOFTIRQ1,
    93 -	KM_TYPE_NR
    94 -};
    95 -
    96 -#endif
    97 -#endif /* __KERNEL__ */
    98 diff -Naurp a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h
    99 --- a/include/asm-mips/fixmap.h	2002-09-27 23:26:03.000000000 +0200
   100 +++ b/include/asm-mips/fixmap.h	2003-07-19 14:18:58.000000000 +0200
   101 @@ -18,7 +18,7 @@
   102  #include <asm/page.h>
   103  #ifdef CONFIG_HIGHMEM
   104  #include <linux/threads.h>
   105 -#include <asm/kmap_types.h>
   106 +#include <linux/kmap_types.h>
   107  #endif
   108  
   109  /*
   110 diff -Naurp a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
   111 --- a/include/asm-mips/highmem.h	2002-12-18 01:03:59.000000000 +0100
   112 +++ b/include/asm-mips/highmem.h	2003-07-19 14:18:58.000000000 +0200
   113 @@ -22,7 +22,6 @@
   114  
   115  #include <linux/init.h>
   116  #include <linux/interrupt.h>
   117 -#include <asm/kmap_types.h>
   118  #include <asm/pgtable.h>
   119  
   120  /* undef for production */
   121 #diff -Naurp a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h
   122 #--- a/include/asm-mips/kmap_types.h	2002-12-18 01:03:59.000000000 +0100
   123 #+++ b/include/asm-mips/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
   124 #@@ -1,14 +0,0 @@
   125 #-#ifndef _ASM_KMAP_TYPES_H
   126 #-#define _ASM_KMAP_TYPES_H
   127 #-
   128 #-enum km_type {
   129 #-	KM_BOUNCE_READ,
   130 #-	KM_SKB_SUNRPC_DATA,
   131 #-	KM_SKB_DATA_SOFTIRQ,
   132 #-	KM_USER0,
   133 #-	KM_USER1,
   134 #-	KM_BIO_IRQ,
   135 #-	KM_TYPE_NR
   136 #-};
   137 #-
   138 #-#endif
   139 diff -Naurp a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
   140 --- a/include/asm-ppc/highmem.h	2003-07-19 14:09:33.000000000 +0200
   141 +++ b/include/asm-ppc/highmem.h	2003-07-19 14:18:58.000000000 +0200
   142 @@ -24,7 +24,7 @@
   143  
   144  #include <linux/init.h>
   145  #include <linux/interrupt.h>
   146 -#include <asm/kmap_types.h>
   147 +#include <linux/kmap_types.h>
   148  #include <asm/pgtable.h>
   149  
   150  /* undef for production */
   151 diff -Naurp a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h
   152 --- a/include/asm-ppc/kmap_types.h	2003-07-19 14:09:33.000000000 +0200
   153 +++ b/include/asm-ppc/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
   154 @@ -1,18 +0,0 @@
   155 -#ifdef __KERNEL__
   156 -#ifndef _ASM_KMAP_TYPES_H
   157 -#define _ASM_KMAP_TYPES_H
   158 -
   159 -enum km_type {
   160 -	KM_BOUNCE_READ,
   161 -	KM_SKB_SUNRPC_DATA,
   162 -	KM_SKB_DATA_SOFTIRQ,
   163 -	KM_USER0,
   164 -	KM_USER1,
   165 -	KM_BH_IRQ,
   166 -	KM_SOFTIRQ0,
   167 -	KM_SOFTIRQ1,
   168 -	KM_TYPE_NR
   169 -};
   170 -
   171 -#endif
   172 -#endif /* __KERNEL__ */
   173 diff -Naurp a/include/asm-ppc64/kmap_types.h b/include/asm-ppc64/kmap_types.h
   174 --- a/include/asm-ppc64/kmap_types.h	2003-07-19 14:09:35.000000000 +0200
   175 +++ b/include/asm-ppc64/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
   176 @@ -1,23 +0,0 @@
   177 -#ifdef __KERNEL__
   178 -#ifndef _ASM_KMAP_TYPES_H
   179 -#define _ASM_KMAP_TYPES_H
   180 -
   181 -enum km_type {
   182 -	KM_BOUNCE_READ,
   183 -	KM_SKB_SUNRPC_DATA,
   184 -	KM_SKB_DATA_SOFTIRQ,
   185 -	KM_USER0,
   186 -	KM_USER1,
   187 -	KM_BIO_SRC_IRQ,
   188 -	KM_BIO_DST_IRQ,
   189 -	KM_PTE0,
   190 -	KM_PTE1,
   191 -	KM_IRQ0,
   192 -	KM_IRQ1,
   193 -	KM_SOFTIRQ0,
   194 -	KM_SOFTIRQ1,	
   195 -	KM_TYPE_NR
   196 -};
   197 -
   198 -#endif
   199 -#endif /* __KERNEL__ */
   200 diff -Naurp a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h
   201 --- a/include/asm-sparc/highmem.h	2003-07-15 10:28:56.000000000 +0200
   202 +++ b/include/asm-sparc/highmem.h	2003-07-19 14:18:58.000000000 +0200
   203 @@ -21,7 +21,7 @@
   204  #ifdef __KERNEL__
   205  
   206  #include <linux/interrupt.h>
   207 -#include <asm/kmap_types.h>
   208 +#include <linux/kmap_types.h>
   209  
   210  /* undef for production */
   211  #define HIGHMEM_DEBUG 1
   212 diff -Naurp a/include/asm-sparc/kmap_types.h b/include/asm-sparc/kmap_types.h
   213 --- a/include/asm-sparc/kmap_types.h	2003-07-19 14:09:37.000000000 +0200
   214 +++ b/include/asm-sparc/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
   215 @@ -1,16 +0,0 @@
   216 -#ifndef _ASM_KMAP_TYPES_H
   217 -#define _ASM_KMAP_TYPES_H
   218 -
   219 -enum km_type {
   220 -	KM_BOUNCE_READ,
   221 -	KM_SKB_SUNRPC_DATA,
   222 -	KM_SKB_DATA_SOFTIRQ,
   223 -	KM_USER0,
   224 -	KM_USER1,
   225 -	KM_BH_IRQ,
   226 -	KM_SOFTIRQ0,
   227 -	KM_SOFTIRQ1,
   228 -	KM_TYPE_NR
   229 -};
   230 -
   231 -#endif
   232 diff -Naurp a/include/asm-sparc64/kmap_types.h b/include/asm-sparc64/kmap_types.h
   233 --- a/include/asm-sparc64/kmap_types.h	2003-07-19 14:09:37.000000000 +0200
   234 +++ b/include/asm-sparc64/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
   235 @@ -1,20 +0,0 @@
   236 -#ifndef _ASM_KMAP_TYPES_H
   237 -#define _ASM_KMAP_TYPES_H
   238 -
   239 -/* Dummy header just to define km_type.  None of this
   240 - * is actually used on sparc64.  -DaveM
   241 - */
   242 -
   243 -enum km_type {
   244 -	KM_BOUNCE_READ,
   245 -	KM_SKB_SUNRPC_DATA,
   246 -	KM_SKB_DATA_SOFTIRQ,
   247 -	KM_USER0,
   248 -	KM_USER1,
   249 -	KM_BH_IRQ,
   250 -	KM_SOFTIRQ0,
   251 -	KM_SOFTIRQ1,
   252 -	KM_TYPE_NR
   253 -};
   254 -
   255 -#endif
   256 diff -Naurp a/include/asm-x86_64/kmap_types.h b/include/asm-x86_64/kmap_types.h
   257 --- a/include/asm-x86_64/kmap_types.h	2003-07-19 14:09:37.000000000 +0200
   258 +++ b/include/asm-x86_64/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
   259 @@ -1,15 +0,0 @@
   260 -#ifndef _ASM_KMAP_TYPES_H
   261 -#define _ASM_KMAP_TYPES_H
   262 -
   263 -enum km_type {
   264 -	KM_BOUNCE_READ,
   265 -	KM_SKB_DATA,
   266 -	KM_SKB_DATA_SOFTIRQ,
   267 -	KM_USER0,
   268 -	KM_USER1,
   269 -	KM_SOFTIRQ0,
   270 -	KM_SOFTIRQ1,
   271 -	KM_TYPE_NR
   272 -};
   273 -
   274 -#endif
   275 diff -Naurp a/include/linux/highmem.h b/include/linux/highmem.h
   276 --- a/include/linux/highmem.h	2003-07-19 14:09:37.000000000 +0200
   277 +++ b/include/linux/highmem.h	2003-07-19 14:18:58.000000000 +0200
   278 @@ -2,6 +2,7 @@
   279  #define _LINUX_HIGHMEM_H
   280  
   281  #include <linux/config.h>
   282 +#include <linux/kmap_types.h>
   283  #include <asm/pgalloc.h>
   284  
   285  #ifdef CONFIG_HIGHMEM
   286 diff -Naurp a/include/linux/kmap_types.h b/include/linux/kmap_types.h
   287 --- a/include/linux/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
   288 +++ b/include/linux/kmap_types.h	2003-07-19 14:18:58.000000000 +0200
   289 @@ -0,0 +1,16 @@
   290 +#ifndef _LINUX_KMAP_TYPES_H
   291 +#define _LINUX_KMAP_TYPES_H
   292 +
   293 +enum km_type {
   294 +	KM_BOUNCE_READ,
   295 +	KM_SKB_SUNRPC_DATA,
   296 +	KM_SKB_DATA_SOFTIRQ,
   297 +	KM_USER0,
   298 +	KM_USER1,
   299 +	KM_BH_IRQ,
   300 +	KM_SOFTIRQ0,
   301 +	KM_SOFTIRQ1,
   302 +	KM_TYPE_NR
   303 +};
   304 +
   305 +#endif
   306