PATCH: innd: separate sockets for IPv4 and IPV6
davidsen at tmr.com
Wed Apr 9 14:30:16 UTC 2008
Julien ÉLIE wrote:
> Hi Miquel,
>> You have to do the setsockopt on every newly opened socket just before
> 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:184.108.40.206:119 ::ffff:85.25.133.:60767 ESTABLISHED
> tcp6 0 0 ::ffff:220.127.116.11: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 @@
>> +#ifdef IPV6_V6ONLY
>> + flag = 1;
>> + if (setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag)) < 0)
>> + sysdie("cannot set IPv6 socket to v6only");
>> /* 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"?
Unless I misunderstand the intent of "V6ONLY" here, if you can't set the
socket type you are not operating as requested, and sysdie is probably
the correct action. syswarn would leave the server in an unintended and
probably undesirable operating mode, if I read this right.
Bill Davidsen <davidsen at tmr.com>
"Woe unto the statesman who makes war without a reason that will still
be valid when the war is over..." Otto von Bismark
More information about the inn-workers