summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-07 18:01:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-07 18:01:06 +0000
commit1b7e045cbfcffa87d97ebc89d7c4a29a5befd460 (patch)
treef3ade963f00f3a3a6238ffb924cb0facd46f4641 /lib
parent1abf0ceeae707dc11623dd9c7ba71dd51859666b (diff)
seed rresvport() for aux channel with a known taken port; do not ask for
next lower port because we might get it (and be predictable!)
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/rcmd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 86f35664e47..727a26e1732 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -133,7 +133,13 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
sigsetmask(oldmask);
return (-1);
}
+#if 0
+ /*
+ * try to rresvport() to the same port. This will make rresvport()
+ * fail it's first bind, resulting in it choosing a random port.
+ */
lport--;
+#endif
if (fd2p == 0) {
write(s, "", 1);
lport = 0;