Skip to Content.
Sympa Menu

ndt-users - "Protocol Error" with web100_userspace-1.6 [was: Re: KNOPPIX NDT in Production]

Subject: ndt-users list created

List archive

"Protocol Error" with web100_userspace-1.6 [was: Re: KNOPPIX NDT in Production]


Chronological Thread 
  • From: Simon Leinen <>
  • To: Richard Carlson <>
  • Cc: Phil Reese <>, ,
  • Subject: "Protocol Error" with web100_userspace-1.6 [was: Re: KNOPPIX NDT in Production]
  • Date: Fri, 29 Sep 2006 15:02:11 +0200

[CC'ing
<>]
Richard Carlson writes:
> The "Protocol Error" message indicates the server failed to receive
> a message from the client. Most of the time this has been due to a
> bug in the web100 user library's IPv6 handling code. I patched that
> library and though it was fixed. Any debugging messages or
> instructions on how to duplicate this problem would be greatly
> appreciated.

After I up(?)graded my web100_userspace from (patched) 1.5 to 1.6, I
had the same problem for IPv4 NDT tests (IPv6 worked fine). So I
checked, and sure enough, the patch for matching IPv4-mapped IPv6
addresses is missing from 1.6. After I applied that patch, it worked
fine again. I'm including a version of the patch adapted to apply
cleanly to web100_userspace-1.6.

Regards,
--
Simon.
--- web100_userland-1.6/lib/web100.c	2006/09/19 16:32:41	1.1
+++ web100_userland-1.6/lib/web100.c	2006/09/19 16:33:15
@@ -767,16 +767,31 @@
         return NULL;
     }
     
+    /* Patch from RAC to handle mapped IPv4 addresses  */
+    int mapped = 0;
+    if (IN6_IS_ADDR_V4MAPPED(&fe6.sin6_addr)) {
+	((struct sockaddr *)&fe6)->sa_family = AF_INET;
+	mapped = 1;
+    }
+
     switch (((struct sockaddr *)&fe6)->sa_family) {
     case AF_INET:
     {
         struct sockaddr_in *ne4 = (struct sockaddr_in *)&ne6;
         struct sockaddr_in *fe4 = (struct sockaddr_in *)&fe6;
         
+
+       if (mapped == 0)
         spec.src_addr = ne4->sin_addr.s_addr;
+       else
+           memcpy(&spec.src_addr, &ne6.sin6_addr.s6_addr[12], 4);
         spec.src_port = ntohs(ne4->sin_port);
+       if (mapped == 0)
         spec.dst_addr = fe4->sin_addr.s_addr;
+       else
+           memcpy(&spec.dst_addr, &fe6.sin6_addr.s6_addr[12], 4);
         spec.dst_port = ntohs(fe4->sin_port);
+
         return web100_connection_find(agent, &spec);
     }
     case AF_INET6:



Archive powered by MHonArc 2.6.16.

Top of Page