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 -dur strace-4.5.16.orig/configure strace-4.5.16/configure
2 --- strace-4.5.16.orig/configure 2007-01-11 23:23:33.000000000 +0100
3 +++ strace-4.5.16/configure 2007-07-14 19:18:43.000000000 +0200
8 +echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
9 +echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
10 +if test "${ac_cv_type_statfs64+set}" = set; then
11 + echo $ECHO_N "(cached) $ECHO_C" >&6
13 + cat >conftest.$ac_ext <<_ACEOF
16 +cat confdefs.h >>conftest.$ac_ext
17 +cat >>conftest.$ac_ext <<_ACEOF
18 +/* end confdefs.h. */
20 +#include <linux/types.h>
21 +#include <sys/statfs.h>
33 +rm -f conftest.$ac_objext
34 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
35 + (eval $ac_compile) 2>conftest.er1
37 + grep -v '^ *+' conftest.er1 >conftest.err
39 + cat conftest.err >&5
40 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
41 + (exit $ac_status); } &&
42 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
43 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
46 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
47 + (exit $ac_status); }; } &&
48 + { ac_try='test -s conftest.$ac_objext'
49 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
52 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
53 + (exit $ac_status); }; }; then
54 + ac_cv_type_statfs64=yes
56 + echo "$as_me: failed program was:" >&5
57 +sed 's/^/| /' conftest.$ac_ext >&5
59 +ac_cv_type_statfs64=no
61 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
64 +echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
65 +echo "${ECHO_T}$ac_cv_type_statfs64" >&6
66 +if test "$ac_cv_type_statfs64" = yes
69 +cat >>confdefs.h <<\_ACEOF
70 +#define HAVE_STATFS64 1
76 { echo "$as_me:$LINENO: checking return type of signal handlers" >&5
77 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }