ndt-dev - Re: [ndt-dev] Patch to improve IPv6
Subject: NDT-DEV email list created
List archive
- From: Aaron Brown <>
- To: Dominic Hamon <>
- Cc: Kavitha Kumar <>, "" <>
- Subject: Re: [ndt-dev] Patch to improve IPv6
- Date: Tue, 15 Jan 2013 14:35:26 -0500
Hey Dominic, Reading single logical statements, or groups of linked statements broken up over #ifdef's is difficult. e.g. + // Determine which family the user would prefer, based on command line. + const int family = +#ifdef AF_INET6 + // options provided by user indicate V6 + (options & OPT_IPV6_ONLY) ? AF_INET6 : +#endif + ((options & OPT_IPV4_ONLY) ? AF_INET : AF_UNSPEC); + + // Prefer IPv6. +#ifdef AF_INET6 + if (family == AF_UNSPEC || family == AF_INET6) { + fai = ai_ipv6; + fai->ai_next = ai_ipv4; + } else { +#else + { +#endif + fai = ai_ipv4; + } + There'a ternary operator broken up over an #ifdef which makes it very difficult to figure out what is going on. I'm guessing you can just assume AF_INET6 exists since in any system in the last decade, it'll be available (especially since we depend on web100, and I can't imagine a web100-enabled host that doesn't have support for compiling against AF_INET6). Cheers, Aaron On Jan 10, 2013, at 5:33 PM, Dominic Hamon <> wrote:
|
- [ndt-dev] Re: Patch to improve IPv6, Dominic Hamon, 01/03/2013
- RE: [ndt-dev] Re: Patch to improve IPv6, Kavitha Kumar, 01/09/2013
- Re: [ndt-dev] Re: Patch to improve IPv6, Dominic Hamon, 01/09/2013
- Re: [ndt-dev] Re: Patch to improve IPv6, Dominic Hamon, 01/10/2013
- Re: [ndt-dev] Re: Patch to improve IPv6, Dominic Hamon, 01/10/2013
- Re: [ndt-dev] Patch to improve IPv6, Aaron Brown, 01/15/2013
- Re: [ndt-dev] Patch to improve IPv6, Dominic Hamon, 01/23/2013
- Re: [ndt-dev] Patch to improve IPv6, Aaron Brown, 01/15/2013
- Re: [ndt-dev] Re: Patch to improve IPv6, Dominic Hamon, 01/10/2013
- Re: [ndt-dev] Re: Patch to improve IPv6, Dominic Hamon, 01/10/2013
- Re: [ndt-dev] Re: Patch to improve IPv6, Dominic Hamon, 01/09/2013
- RE: [ndt-dev] Re: Patch to improve IPv6, Kavitha Kumar, 01/09/2013
Archive powered by MHonArc 2.6.16.