rx/simple.example broken (Re: [OpenAFS-devel] IPv6 Status)

chas williams - CONTRACTOR chas@cmf.nrl.navy.mil
Mon, 5 Mar 2012 11:37:44 -0500


On Sun, 4 Mar 2012 09:48:07 +0000
Simon Wilkinson <simonxwilkinson@gmail.com> wrote:

> On 4 Mar 2012, at 04:34, "Chas Williams (CONTRACTOR)" <chas@cmf.nrl.navy.mil> wrote:
> 
> > this seems to build correctly on centos 6.2 with the 1_6_x branch.
> 
> Any work on RX really needs to be based on the current master tree. There's quite a lot of work been done there, in particular in terms of structure hiding, that are an important precursor to IPv6.

i agree.  but i am merely pointing it out as a reference point. i.e. i
dont think the .xg file is broken.  it appears that the split/cleanup
of rx header files along with the accessor routines wasnt quite complete
for rxgen.  this seems to fix rxgen problems with rx.simple.

diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c
index 0ebaefa..0356c2c 100644
--- a/src/rxgen/rpc_parse.c
+++ b/src/rxgen/rpc_parse.c
@@ -1329,8 +1329,8 @@ cs_ProcTail_setup(definition * defp, int split_flag)
 	} else {
 	    f_print(fout,
 		    "\t    rx_RecordCallStatistics(z_call, \n"
-		    "\t\t(((afs_uint32)(ntohs(z_call->conn->serviceId) << 16)) |\n"
-		    "\t\t((afs_uint32)ntohs(z_call->conn->peer->port))),\n");
+		    "\t\t(((afs_uint32)(ntohs(rx_ServiceIdOf(rx_ConnectionOf(z_call))) << 16)) |\n"
+		    "\t\t((afs_uint32)ntohs(rx_PortOf(rx_PeerOf(rx_ConnectionOf(z_call)))))),\n");
 	}
 	f_print(fout, "\t\t%d, %sNO_OF_STAT_FUNCS, 1);\n",
 		no_of_stat_funcs, PackagePrefix[PackageIndex]);


this is starting to look like lisp.  there are two other places in rxgen
that needs fixed as well but this is the minimum fix for troy's problem.

> > besides changing sockaddr_in with sockaddr_in6 
> 
> The real problem with RX is the use of afs_int32 and friends to represent network addresses. That's going to need to be replaced with a more generic structure (hopefully a union of various types so we can generalise our protocol support further in the future)

yeah sockaddr_storage is that union--unless you plan to run afs over
something that doesnt have sockets.