Hi Willy,
> I don't like much mixing IPv4 and IPv6 together in the #ifdef, > because I don't know if IPV6_TCLASS is defined on all libcs, > especially old ones or embedded ones, where it could result in > disabling the IPv4 setting. I cannot aggree more, but how should we handle this when parsing the configuration? Currently, when IP_TOS is not defined, we Alert() and abort (goto out_err). Since set-tos us a unique configuration, we have the following options: - both IP_TOS and IPV6_TCLASS needs to be defined, otherwise we abort (this breaks set-tos for the case you mentioned) - require absolutly IP_TOS, and make IPV6_TCLASS optional (but we need to warn the user somehow - can we just Alert() without "goto out_err" in this case?) - make a new option dedicated to IPv6 (I don't like it as well) I think the second option make most sense in this case, do you agree? > This would only call the second one if the first fails, which according > to your tests should not happen. No, we can't test this, because setsockopt always returns 0 when the address-family is AF_INET6. Let me do a few more tests with this. I would like to test a newer kernel, because the setsockopt's behavior is not exactly helpful in this case, perhaps its kernel specific. > Or you can even put that more elegantly in an inline function : Agreed, if the #ifdef'ing and if()'ing increases we should go for that definitely, since we are doing this in two places (request and response). Regards, Lukas