PATCH: innd: separate sockets for IPv4 and IPV6
Julien ÉLIE
julien at trigofacile.com
Fri Apr 4 16:28:59 UTC 2008
Hi Miquel,
> You have to do the setsockopt on every newly opened socket just before
> bind().
All right.
> Completely untested of course, probably doesn't even compile.
Thanks for the patch. It compiles very well.
And it seems to work since "netstat -tn" gives without it:
tcp6 0 0 ::ffff:91.121.26.68:119 ::ffff:85.25.133.:60767 ESTABLISHED
tcp6 0 0 ::ffff:91.121.26.68:119 ::ffff:87.106.161:53225 ESTABLISHED
whereas only real IPv6 connexions are marked when your patch is applied.
> +++ inn-CURRENT-20080324/lib/network.c 2008-03-24 21:16:15.000000000 +0100
> @@ -241,6 +244,12 @@
> }
> network_set_reuseaddr(fd);
>
> +#ifdef IPV6_V6ONLY
> + flag = 1;
> + if (setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag)) < 0)
> + sysdie("cannot set IPv6 socket to v6only");
> +#endif
> +
> /* Accept "any" or "all" in the bind address to mean 0.0.0.0. */
> if (!strcmp(address, "any") || !strcmp(address, "all"))
> address = "::";
Shouldn't it be a "syswarn" here instead of a "sysdie"?
--
Julien ÉLIE
« Maior e longinquo reuerentia. » (Tacite)
More information about the inn-workers
mailing list