Skip to Content.
Sympa Menu

ndt-dev - Re: [ndt-dev] Patch to improve IPv6

Subject: NDT-DEV email list created

List archive

Re: [ndt-dev] Patch to improve IPv6


Chronological Thread 
  • From: Dominic Hamon <>
  • To: Dominic Hamon <>
  • Cc: Aaron Brown <>, Kavitha Kumar <>, "" <>
  • Subject: Re: [ndt-dev] Patch to improve IPv6
  • Date: Mon, 4 Feb 2013 11:17:04 -0800

any feedback on this?


On Wed, Jan 23, 2013 at 11:09 AM, Dominic Hamon <> wrote:
Hi

Sorry for the delay. New patch attached that assumes AF_INET6 is defined and errors if it's not at compile time.


On Tue, Jan 15, 2013 at 11:35 AM, Aaron Brown <> wrote:
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:

Forgot the patch.

On Thu, Jan 10, 2013 at 2:32 PM, Dominic Hamon <> wrote:
Added comments to the patch attached. It's possible that it failed for you as the first host returned was invalid. This patch will no longer try every address, only the first IPv6 and then first IPv4.

One of the defines controls whether IPv6 is compiled in to NDT. Would it be possible to default this to 'on' and remove the define from the codebase? It would simplify much of the logic in this file.

On Wed, Jan 9, 2013 at 12:41 PM, Dominic Hamon <> wrote:
Hi

No problem, I'll look at cleaning it up once I'm sure that it's working for you.

I've tested on boxes that are both v4/v6 enabled and just v4 enabled and my test matrix was successful. I also had a colleague test and he confirmed.

The logic is complicated due to the existing ifdefs regarding V6 availability - it would be much simpler if we could assume that v6 support should be built in, and then let the OS v6 availability dictate the feature being available. Is that something that you'd consider reasonable?

Essentially, we first determine which family we want, then filter out the list of available families to those that match the request, then attempt connection preferring v6. In all cases we connect using inet_addr_any equivalents to ensure that v6 servers will accept connections from v4.



On Wed, Jan 9, 2013 at 11:50 AM, Kavitha Kumar <> wrote:
Hi Dominic,

   This patch didn't seem to work when I installed it. I tried out a few combinations of IP-version options at the web100srv and web100clt, and a complete list of the combinations I tried is attached alongwith.

Also, its somewhat difficult to follow the logic you have added. Is there a way you could clean up the ifdefs to make the code easier to read? The ternary operators and if-else's spread across the ifdefs are tough to debug. A few more comments may help too.

Thanks again, and sorry about the delayed response.
Kavitha

From: [] on behalf of Dominic Hamon []
Sent: Thursday, January 03, 2013 2:56 PM
To: Dominic Hamon
Cc:
Subject: [ndt-dev] Re: Patch to improve IPv6

Sorry for the followup, but I found a bug in the last version.

Attached please find a better version.

On Fri, Dec 21, 2012 at 9:46 AM, Dominic Hamon <> wrote:
Hello

Please find attached a patch to improve IPv6 support in NDT. With this patch, if no address family is specified on the command line, web100srv will listen for both IPv4 and IPv6 connections (if supported). Similarly, clients will attempt to connect to either IPv4 or IPv6 servers if address family is not specified on the command line.

Thank you for your consideration.

Dominic Hamon | Measurement Lab




<ndt.ipv4v6.patch>






Archive powered by MHonArc 2.6.16.

Top of Page