diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-09-22 20:52:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-09-22 20:52:56 +0000 |
commit | b58edf324a1113212322f0ec59dd47d8cf183a23 (patch) | |
tree | 32773a19bade9c7aaf92ae145cb00fd1ce06a070 | |
parent | 65e71898b7e8e8cb4372a9124f1ed84e8892ef25 (diff) |
-s was using the wrong arg (PF_INET) for protocol instead of IPPROTO_TCP & IPPROTO_UDP for pmap_set()
-rw-r--r-- | usr.bin/rpcinfo/rpcinfo.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c index ddcaf19e6ac..c5d4e1c0939 100644 --- a/usr.bin/rpcinfo/rpcinfo.c +++ b/usr.bin/rpcinfo/rpcinfo.c @@ -1,9 +1,9 @@ -/* $OpenBSD: rpcinfo.c,v 1.9 2003/06/10 22:20:50 deraadt Exp $ */ +/* $OpenBSD: rpcinfo.c,v 1.10 2005/09/22 20:52:55 deraadt Exp $ */ #ifndef lint /*static char sccsid[] = "from: @(#)rpcinfo.c 1.22 87/08/12 SMI";*/ /*static char sccsid[] = "from: @(#)rpcinfo.c 2.2 88/08/11 4.0 RPCSRC";*/ -static char rcsid[] = "$OpenBSD: rpcinfo.c,v 1.9 2003/06/10 22:20:50 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rpcinfo.c,v 1.10 2005/09/22 20:52:55 deraadt Exp $"; #endif /* @@ -622,10 +622,17 @@ setreg(int argc, char **argv) if (port_num >= 65536) usage("port number out of range"); - if ((pmap_set(prog_num, version_num, PF_INET, + if ((pmap_set(prog_num, version_num, IPPROTO_TCP, (u_short)port_num)) == 0) { fprintf(stderr, "rpcinfo: Could not set registration " - "for prog %s version %s port %s\n", + "for prog %s version %s port %s protocol IPPROTO_TCP\n", + argv[0], argv[1], argv[2]); + exit(1); + } + if ((pmap_set(prog_num, version_num, IPPROTO_UDP, + (u_short)port_num)) == 0) { + fprintf(stderr, "rpcinfo: Could not set registration " + "for prog %s version %s port %s protocol IPPROTO_UDP\n", argv[0], argv[1], argv[2]); exit(1); } |