dCache / oncrpc4j

Pure Java implementation of ONCRPC/SUNRPC
Other
30 stars 30 forks source link

Portmap issue? #44

Open mharj opened 8 years ago

mharj commented 8 years ago

When checking portmapper from Linux I see something strange on service list

# rpcinfo -p 10.10.10.20
   program vers proto   port  service
    100004    1   udp  51014  ypserv
    100004    24294967295  64916  ypserv
    100004    2   udp  51014  ypserv
    100000    2   tcp    111  portmapper
    100007    2   tcp  64833  ypbind
    100004    14294967295  64916  ypserv
    100004    2   tcp  64916  ypserv
    100004    1   tcp  64916  ypserv
    100000    2   udp    111  portmapper
    100007    2   udp  51010  ypbind
    100007    24294967295  64833  ypbind

Also command fails to connect to actual services

# rpcinfo -u 10.10.10.20 ypserv 1
rpcinfo: RPC: Remote system error
program 100004 version 1 is not available

Code is just simple stub classes running on Windows NetBeans

public class YpService {
    private final static int RPC_YPPROG = 100004;
    private final static int RPC_YPBIND = 100007;

    public static void main(String[] args) {
        new OncRpcEmbeddedPortmap(); 
        YpBindProg ypBind = new YpBindProg();
        YpProg ypProg = new YpProg();
        OncRpcSvc ypBindService = new OncRpcSvcBuilder()
                .withUDP()
                .withTCP()
                .withAutoPublish()
                .withSameThreadIoStrategy()
                .withRpcService(new OncRpcProgram(RPC_YPBIND, 2),ypBind)
                .build();
        OncRpcSvc ypService = new OncRpcSvcBuilder()
                .withUDP()
                .withTCP()
                .withAutoPublish()
                .withSameThreadIoStrategy()
                .withRpcService(new OncRpcProgram(RPC_YPPROG, 1),ypProg)
                .withRpcService(new OncRpcProgram(RPC_YPPROG, 2),ypProg)
                .build();       
        try {
            ypBindService.start();
            ypService.start();
            System.in.read();
        } catch (IOException ex) {
            Logger.getLogger(YpService.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

Libs are core-2.5.3 guava-19.0 grizzly-framework-2.3.25 (slf4+auth deps)

kofemann commented 8 years ago

I can't reproduce that:

 $ rpcinfo -p                        (git)-[forget-bad-ds] 
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100007    2   tcp  38903  ypbind
    100007    2   udp  60872  ypbind
    100004    1   tcp  45918  ypserv
    100004    2   tcp  45918  ypserv
    100004    1   udp  55856  ypserv
    100004    2   udp  55856  ypserv
$

Which OS do you have? I run on Fedora 23. Additionally I have configure rpcbind to accept connections from non root users:

# cat /etc/sysconfig/rpcbind
#
# Optional arguments passed to rpcbind. See rpcbind(8)
RPCBIND_ARGS="-i"
mharj commented 8 years ago

Just checking OncRpcSvcTest cases as I'm probably doing wrong way something on code

mharj commented 8 years ago

Hmm, can't see any issue on code .. just copy&paste main page dummy RpcDispatchable and still same. This is not Linux rpc as it's running in Windows with OncRpcEmbeddedPortmap, so I don't think -i should affect. I'm continue debug with test cases if I notice why test cases work ok, but not if running via OncRpcEmbeddedPortmap

kofemann commented 8 years ago

Confirmed. this is an issue with OncRpcEmbeddedPortmap.

mharj commented 8 years ago

Ok, I'm playing with test cases and see if I manage to build and spot issue

kofemann commented 8 years ago

the problem is triggered by client with IPv6 interfaces. I am working on fix.

mharj commented 8 years ago

Yeah, noticed netid "Unknown" already