Jan Engelhardt wrote:
On Friday 2009-09-04 08:07, Amos Jeffries wrote:
Also, I have written a Python test script to test TProxy functionality
automatically both for IPv4 and IPv6, I can post that as well if anyone is
interested.
I'm interested :)
Now that you have done this I'm going to have to find a robust userland
run-time test to see if the underlying TPROXY is v4-only or v6-enabled. If
anyone has suggestions they would be welcome.
Would this perhaps suffice?
assert(socket(PF_INET6, ...) >= 0);
assert(setsockopt(fd, SOL_IP, IP_TRANSPARENT, ...) == 0);
assert(bind(fd, {::2}) == 0);
At least something like that I remember to have used to determine
tproxy-2.x ipv4 availability in the days. (I.e. seeing if setsockopt
failed.)
Thanks Jan. I gave a variant that a try. It does seem to detect the
feature support nicely.
However, trying to bind the real IP:port soon after results in "(98)
Address already in use" even with a shutdown(tmp_sock,...) added to
clean up after the test.
AYJ
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html