summaryrefslogtreecommitdiffstats
path: root/src/plug-nis.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2009-05-14 15:49:05 -0400
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2009-05-14 15:49:05 -0400
commit354f04cbc26d2816650187eb6e480346e2006a69 (patch)
tree4e0962c74939fa12cd64a8028195cd1306486820 /src/plug-nis.c
parent3e812ec5be1f894e50b6fdbc8e265a37ace8a9d1 (diff)
downloadslapi-nis-354f04cbc26d2816650187eb6e480346e2006a69.tar.gz
slapi-nis-354f04cbc26d2816650187eb6e480346e2006a69.tar.xz
slapi-nis-354f04cbc26d2816650187eb6e480346e2006a69.zip
- when not configured to use a specific port, bindresvport to a datagram
socket so that we avoid trying to use the same one that we might be using for a portmap client socket
Diffstat (limited to 'src/plug-nis.c')
-rw-r--r--src/plug-nis.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plug-nis.c b/src/plug-nis.c
index dfc776f..e6edf4a 100644
--- a/src/plug-nis.c
+++ b/src/plug-nis.c
@@ -307,9 +307,10 @@ plugin_state_init(Slapi_PBlock *pb, struct plugin_state **lstate)
/* Figure out what kind of socket we need, and a textual
* term to use in log messages. */
pf = (i & 2) ? PF_INET : PF_INET6;
- type = (i & 1) ? SOCK_DGRAM : SOCK_STREAM;
- sock_desc = (i & 2) ? ((i & 1) ? "tcp" : "udp") :
- ((i & 1) ? "tcp6" : "udp6");
+ type = (i & 1) ? SOCK_STREAM: SOCK_DGRAM;
+ sock_desc = (pf == PF_INET6) ?
+ ((type == SOCK_DGRAM) ? "udp6" : "tcp6") :
+ ((type == SOCK_DGRAM) ? "udp" : "tcp");
/* Allocate the socket. */
sockfd = socket(pf, type, 0);
if (sockfd == -1) {