TUX not relaying requests? (Problem solved!)

William M. Shubert wms at igoweb.org
Sat Jul 23 06:56:04 UTC 2005


First I'd like to thank everybody who took the time to answer. I checked
what each person suggested, but in every case my system was set up the
way that they recommended.

Since none of the "it sounds like..." responses were working out, I took
the time to to investigate some more. Since turning on debugging made
the kernel panic, I instead added a printk at each juncture where tux
was deciding whether or not to forward. Luckily, this did not make any
panics, and in fact found the problem. The problem is in these lines of
net/tux/redirect.c:

	if (sk->sk_family != AF_INET) {
		sock_put(sk);
		goto out;
	}

It turns out that Java creates IPv6 sockets when possible, giving you an
sk_family of AF_INET6 instead of AF_INET! When I tried Apache, that also
failed, because the Apache that comes with FC3 is also set up to create
IPv6 sockets when possible!

I don't know whether or not simpling changing the check to allow AF_INET
or AF_INET6 sockets would work - at some level Linux lets IPv6 talk to
IPv4, but whether or not the Tux forwarding would work with that, I
can't say and I have not tested it.

I did find that adding this to my "startup.sh" for tomcat fixed the
problem:

	JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"

I do not know what the corresponding Apache configuration option is, but
I suspect that there is one.

So again, thanks to everybody who responded. If anybody has a similar
problem, take a close look at the output of "netstat --tcp --listen -n"
to make sure that your client web server is using IPv4! It would also be
nice to get a Tux that would work with IPv6 eventually.




More information about the tux-list mailing list