From 354f04cbc26d2816650187eb6e480346e2006a69 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 14 May 2009 15:49:05 -0400 Subject: - 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 --- src/plug-nis.c | 7 ++++--- 1 file 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) { -- cgit