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 diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
2 --- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:30:53.000000000 +0200
3 +++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:31:24.000000000 +0200
5 # ifdef __UCLIBC_HAS_XLOCALE__
6 _M_data->_M_decimal_point = __cloc->decimal_point_wc;
7 _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
9 +# elif defined __UCLIBC_HAS_LOCALE__
10 _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
11 _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
14 # ifdef __UCLIBC_HAS_XLOCALE__
15 _M_data->_M_decimal_point = __cloc->decimal_point_wc;
16 _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
18 +# elif defined __UCLIBC_HAS_LOCALE__
19 _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
20 _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
22 diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
23 --- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:30:53.000000000 +0200
24 +++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:31:24.000000000 +0200
28 // NB: In the GNU model wchar_t is always 32 bit wide.
29 +#ifdef __UCLIBC_MJN3_ONLY__
30 +#warning fix this... should be numeric
33 +# ifdef __UCLIBC_HAS_XLOCALE__
34 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
35 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
36 +# elif defined __UCLIBC_HAS_LOCALE__
37 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
38 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
41 union { char *__s; wchar_t __w; } __u;
42 __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
43 _M_data->_M_decimal_point = __u.__w;
45 __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
46 _M_data->_M_thousands_sep = __u.__w;
49 if (_M_data->_M_thousands_sep == L'\0')
50 _M_data->_M_grouping = "";