From c7ded5ab0accc54a28df4d43cb923e6c808ff347 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Jan 2005 10:24:36 +0000 Subject: r5108: the beginnings of a nbtd server for Samba4. Currently just displays the packets it receives, but it at least shows how the server structure will work. To implement it I extended the libcli/nbt/ library to allow for an incoming packet handler to be registered. That allows the nbt client library to be used for low level processing of the nbtd server packets. Other changes: - made the socket library always set SO_REUSEADDR when binding to an interface, to ensure that restarts of a server don't have to wait for a couple of minutes. - made the nbt port configurable. Defaults to 137, but other ports will be useful for testing. (This used to be commit 2fedca6adfd4df9e85cc86896dfa79630777a917) --- source4/smbd/config.mk | 10 ++++++++++ source4/smbd/service_stream.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/smbd') diff --git a/source4/smbd/config.mk b/source4/smbd/config.mk index 4d5e929c79..39697205f6 100644 --- a/source4/smbd/config.mk +++ b/source4/smbd/config.mk @@ -40,6 +40,16 @@ REQUIRED_SUBSYSTEMS = \ # End MODULE server_ldap ################################################ +################################################ +# Start MODULE server_service_nbtd +[MODULE::server_service_nbtd] +INIT_FUNCTION = server_service_nbtd_init +SUBSYSTEM = SERVER_SERVICE +REQUIRED_SUBSYSTEMS = \ + NBTD +# End MODULE server_service_nbtd +################################################ + ####################### # Start SUBSYSTEM SERVICE [SUBSYSTEM::SERVER_SERVICE] diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index 0d29c9fcb8..1662e9005f 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -170,7 +170,7 @@ NTSTATUS stream_setup_socket(struct event_context *event_context, talloc_steal(stream_socket, stream_socket->sock); /* ready to listen */ - status = socket_set_option(stream_socket->sock, "SO_KEEPALIVE SO_REUSEADDR=1", NULL); + status = socket_set_option(stream_socket->sock, "SO_KEEPALIVE", NULL); NT_STATUS_NOT_OK_RETURN(status); status = socket_set_option(stream_socket->sock, lp_socket_options(), NULL); -- cgit