Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portmap issue? #44

Open
mharj opened this issue Jun 5, 2016 · 7 comments
Open

Portmap issue? #44

mharj opened this issue Jun 5, 2016 · 7 comments
Labels

Comments

@mharj
Copy link
Contributor

mharj commented Jun 5, 2016

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
Copy link
Member

kofemann commented Jun 5, 2016

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
Copy link
Contributor Author

mharj commented Jun 5, 2016

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

@mharj
Copy link
Contributor Author

mharj commented Jun 5, 2016

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
Copy link
Member

kofemann commented Jun 5, 2016

Confirmed. this is an issue with OncRpcEmbeddedPortmap.

@kofemann kofemann added the bug label Jun 5, 2016
@mharj
Copy link
Contributor Author

mharj commented Jun 5, 2016

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

kofemann added a commit to kofemann/oncrpc4j that referenced this issue Jun 5, 2016
Motivation:
the rfc 1833 specifies only TCP (6) and UDP (17) transports. Any other transport
will be mapped to '-1'. Nevertheless, missing mapping was ignored and
sent to rpcbind.

Modification:
du not sent mapping request to rpcbind if transport is not supported.

Result:
no weird entries in portmap v2;

Fixes: dCache#44
Acked-by: 
Target: master, 2.5
@kofemann
Copy link
Member

kofemann commented Jun 5, 2016

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

@mharj
Copy link
Contributor Author

mharj commented Jun 5, 2016

Yeah, noticed netid "Unknown" already

kofemann added a commit that referenced this issue Jun 6, 2016
Motivation:
the rfc 1833 specifies only TCP (6) and UDP (17) transports. Any other transport
will be mapped to '-1'. Nevertheless, missing mapping was ignored and
sent to rpcbind.

Modification:
du not sent mapping request to rpcbind if transport is not supported.

Result:
no weird entries in portmap v2;

Issue: #44
Acked-by: Paul Millar
Target: master, 2.5
kofemann added a commit that referenced this issue Jun 6, 2016
Motivation:
the rfc 1833 specifies only TCP (6) and UDP (17) transports. Any other transport
will be mapped to '-1'. Nevertheless, missing mapping was ignored and
sent to rpcbind.

Modification:
du not sent mapping request to rpcbind if transport is not supported.

Result:
no weird entries in portmap v2;

Issue: #44
Acked-by: Paul Millar
Target: master, 2.5
(cherry picked from commit 5b12f16)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants