Project

General

Profile

Actions

Bug #4456

closed

snoop(1m) should display remote RPC calls in summary mode

Added by Marcel Telka almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
cmd - userland programs
Start date:
2014-01-10
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

In a case there is a remote RPC call (CALLIT, BCAST, or INDIRECT) snoop(1m) in summary mode displays the encapsulated RPC call, not the remote RPC call itself.

Here is an example:

# snoop -r -d lo0 
Using device lo0 (promiscuous mode)
   127.0.0.1 -> 127.0.0.1    RPCBIND C GETTIME
   127.0.0.1 -> 127.0.0.1    RPCBIND C GETTIME
   127.0.0.1 -> 127.0.0.1    RPCBIND R GETTIME 
   127.0.0.1 -> 127.0.0.1    RPCBIND R GETTIME

The 1st and 4th packets above is the remote call, the 2nd and 3rd packet is the normal (non-remote) RPC call.

The same traffic in verbose summary mode:

# snoop -r -d lo0 -V
Using device lo0 (promiscuous mode)
________________________________
   127.0.0.1 -> 127.0.0.1    IPNET src zone 0 dst zone 0
   127.0.0.1 -> 127.0.0.1    IP  D=127.0.0.1 S=127.0.0.1 LEN=84, ID=0, TOS=0x0, TTL=255
   127.0.0.1 -> 127.0.0.1    UDP D=111 S=47279 LEN=64
   127.0.0.1 -> 127.0.0.1    RPC C XID=1389445658 PROG=100000 (PMAP) VERS=4 PROC=5
   127.0.0.1 -> 127.0.0.1    RPCBIND C BCAST prog=PMAP vers=4 proc=6
   127.0.0.1 -> 127.0.0.1    RPCBIND C GETTIME
________________________________
   127.0.0.1 -> 127.0.0.1    IPNET src zone 0 dst zone 0
   127.0.0.1 -> 127.0.0.1    IP  D=127.0.0.1 S=127.0.0.1 LEN=68, ID=0, TOS=0x0, TTL=255
   127.0.0.1 -> 127.0.0.1    UDP D=111 S=37197 LEN=48
   127.0.0.1 -> 127.0.0.1    RPC C XID=3021490624 PROG=100000 (PMAP) VERS=4 PROC=6
   127.0.0.1 -> 127.0.0.1    RPCBIND C GETTIME
________________________________
   127.0.0.1 -> 127.0.0.1    IPNET src zone 0 dst zone 0
   127.0.0.1 -> 127.0.0.1    IP  D=127.0.0.1 S=127.0.0.1 LEN=56, ID=0, TOS=0x0, TTL=255
   127.0.0.1 -> 127.0.0.1    UDP D=37197 S=111 LEN=36
   127.0.0.1 -> 127.0.0.1    RPC R (#2) XID=3021490624 Success
   127.0.0.1 -> 127.0.0.1    RPCBIND R GETTIME 
________________________________
   127.0.0.1 -> 127.0.0.1    IPNET src zone 0 dst zone 0
   127.0.0.1 -> 127.0.0.1    IP  D=127.0.0.1 S=127.0.0.1 LEN=80, ID=0, TOS=0x0, TTL=255
   127.0.0.1 -> 127.0.0.1    UDP D=47279 S=37197 LEN=60
   127.0.0.1 -> 127.0.0.1    RPC R (#1) XID=1389445658 Success
   127.0.0.1 -> 127.0.0.1    RPCBIND R BCAST Uaddr=127.0.0.1.0.111 len=4
   127.0.0.1 -> 127.0.0.1    RPCBIND R GETTIME

The issue is reproducible using this:

$ cat rmtcall.c 
#include <rpc/rpc.h>
#include <netconfig.h>
#include <rpc/rpcb_prot.h>
#include <netdir.h>

int
main(int argc, char **argv)
{
    struct netconfig *nconf;
    ulong_t ret;
    struct timeval tout;
    struct netbuf *svca;
    char *addr;

    if (argc < 2)
        addr = "localhost";
    else
        addr = argv[1];

    nconf = getnetconfigent("udp");

    tout.tv_sec = 10;
    tout.tv_usec = 0;

    svca = uaddr2taddr(nconf, addr);

    (void) rpcb_rmtcall(nconf,
        addr, RPCBPROG,
        RPCBVERS4, RPCBPROC_GETTIME,
        xdr_void, NULL,
        xdr_u_long, (caddr_t)&ret,
        tout, svca);

    return (0);
}
$ gcc -lnsl -o rmtcall rmtcall.c 
$ ./rmtcall 
$

Related issues

Related to illumos gate - Bug #4481: snoop(1m) does not decode time in GETTIME rpcbind operationResolvedMarcel Telka2014-01-14

Actions
Related to illumos gate - Bug #4483: rpcbind: Reply for remote calls comes from incorrect UDP portResolvedMarcel Telka2014-01-15

Actions
Actions

Also available in: Atom PDF