git » nmdb » commit 0f84cf9

Use TIPC_ADDR_NAME and TIPC_ADDR_NAMESEQ conditionally according to the ports.

author Alberto Bertogli
2006-09-12 19:27:59 UTC
committer Alberto Bertogli
2006-09-12 19:27:59 UTC
parent dacdc2ad112b9a745b662f6e5b63a94262c2d864

Use TIPC_ADDR_NAME and TIPC_ADDR_NAMESEQ conditionally according to the ports.
There's no need to use NAMESEQ if we're only binding to just one port, so use
NAME in that case.

nmdb/tipc.c +5 -1

diff --git a/nmdb/tipc.c b/nmdb/tipc.c
index 0a5c908..91feab0 100644
--- a/nmdb/tipc.c
+++ b/nmdb/tipc.c
@@ -209,7 +209,11 @@ int tipc_init(void)
 	static struct sockaddr_tipc srvsa;
 
 	srvsa.family = AF_TIPC;
-	srvsa.addrtype = TIPC_ADDR_NAMESEQ;
+	if (settings.tipc_lower == settings.tipc_upper)
+		srvsa.addrtype = TIPC_ADDR_NAME;
+	else
+		srvsa.addrtype = TIPC_ADDR_NAMESEQ;
+
 	srvsa.addr.nameseq.type = SERVER_TYPE;
 	srvsa.addr.nameseq.lower = settings.tipc_lower;
 	srvsa.addr.nameseq.upper = settings.tipc_upper;