summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-01-16 12:05:09 +0100
committerStefan Metzmacher <metze@samba.org>2017-01-27 08:09:15 +0100
commit9d60ad53b809281a5a6f6ad82a0daea99c989f2d (patch)
treeb70f0c2a3eab8517af2fa47983719fb2add018f6 /source4/smbd
parent35dfa5c6e2bf60f8f1efda5eb7026cabe8bf5ba3 (diff)
downloadsamba-9d60ad53b809281a5a6f6ad82a0daea99c989f2d.tar.gz
rpc_server: Allow to configure the port range for RPC services
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12521 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/service_stream.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c
index 8abaaca272c..29e6515622b 100644
--- a/source4/smbd/service_stream.c
+++ b/source4/smbd/service_stream.c
@@ -30,10 +30,6 @@
#include "../lib/tsocket/tsocket.h"
#include "lib/util/util_net.h"
-/* the range of ports to try for dcerpc over tcp endpoints */
-#define SERVER_TCP_LOW_PORT 49152
-#define SERVER_TCP_HIGH_PORT 65535
-
/* size of listen() backlog in smbd */
#define SERVER_LISTEN_BACKLOG 10
@@ -332,7 +328,9 @@ NTSTATUS stream_setup_socket(TALLOC_CTX *mem_ctx,
if (!port) {
status = socket_listen(stream_socket->sock, socket_address, SERVER_LISTEN_BACKLOG, 0);
} else if (*port == 0) {
- for (i=SERVER_TCP_LOW_PORT;i<= SERVER_TCP_HIGH_PORT;i++) {
+ for (i = lpcfg_rpc_low_port(lp_ctx);
+ i <= lpcfg_rpc_high_port(lp_ctx);
+ i++) {
socket_address->port = i;
status = socket_listen(stream_socket->sock, socket_address,
SERVER_LISTEN_BACKLOG, 0);