Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solaris 10 box dislikes RPC IPv6

6 views
Skip to first unread message

Robert M. Gary

unread,
Nov 5, 2009, 2:34:38 PM11/5/09
to
I"m doing some IPv6 porting on some code that uses Sun RPC. Its
working on all my IPv6 configured Solaris machines but one. On this
machine I can ping ::1, I can register my process with the rpcbinder
but I can't get the rpcbinder to return the address when quered for
the IPv6 interfac (the v4 works fine)....

int
main(int argc, char*argv[])
{

int rpcversion = 54321;
char *netType4 = (char*)"tcp";
char *netType6 = (char*)"tcp6";

struct netconfig * netConfig4 = getnetconfigent(netType4);
struct netconfig * netConfig6 = getnetconfigent(netType6);


int result = svc_create(messageHandler, rpcversion, 4, "tcp");
cout<<"Created "<<result<<" interfaces"<<endl;

netbuf buf;
buf.buf = (char*) malloc(256);
buf.maxlen = 256;

//
// First we try with ipv6
//
bool bresult = rpcb_getaddr( rpcversion, 4, netConfig6, &buf, "::
1" );
sockaddr_in* sock = (sockaddr_in*)buf.buf;
if ( bresult == true )
{
printf("v6 result is %d\n", sock->sin_port);
}

bool bresult2 = rpcb_getaddr( rpcversion, 4, netConfig4, &buf,
"127.0.0.1" );

sockaddr_in* sock2 = (sockaddr_in*)buf.buf;
if ( bresult2 == true )
{
printf("v4 result is %d\n", sock2->sin_port);
}


}
Output:
Created 2 interfaces
v4 result is 32977

(notice to v6 result)

Each time svc_create shows it created 2 connections. rpcinfo shows
both...
54321 4 tcp6 ::.128.202 - 365
54321 4 tcp 0.0.0.0.128.203 - 365

But rpcb_getaddr only returns the IPv4 connection.

How can I further debug this?

-robert

Thomas Maier-Komor

unread,
Nov 6, 2009, 3:35:19 AM11/6/09
to
Robert M. Gary schrieb:

Hi Robert,

this looks a little bit like the issue I am having with getnameinfo (see
my earlier post to cus from 5th of November). I also get a valid
connection but getnameinfo always fails.

You could truss the relevant process with '-u libsocket', then
getnameinfo queries should show up. If they return a value != 0 this
means an error. I am always getting a return value of 5.

- Thomas

0 new messages