summaryrefslogtreecommitdiff
path: root/source4/lib/socket/socket_ipv4.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-30 10:24:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:23 -0500
commitc7ded5ab0accc54a28df4d43cb923e6c808ff347 (patch)
treeeabb1e05c05f8ce01b0ffbf1fda038a80fc237a0 /source4/lib/socket/socket_ipv4.c
parenta0ab1f7afda62964d480af9dc26e60a38d1350e0 (diff)
downloadsamba-c7ded5ab0accc54a28df4d43cb923e6c808ff347.tar.gz
samba-c7ded5ab0accc54a28df4d43cb923e6c808ff347.tar.bz2
samba-c7ded5ab0accc54a28df4d43cb923e6c808ff347.zip
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)
Diffstat (limited to 'source4/lib/socket/socket_ipv4.c')
-rw-r--r--source4/lib/socket/socket_ipv4.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/lib/socket/socket_ipv4.c b/source4/lib/socket/socket_ipv4.c
index aaa5ce0fa2..09a4b4a73a 100644
--- a/source4/lib/socket/socket_ipv4.c
+++ b/source4/lib/socket/socket_ipv4.c
@@ -139,6 +139,8 @@ static NTSTATUS ipv4_listen(struct socket_context *sock,
struct ipv4_addr ip_addr;
int ret;
+ socket_set_option(sock, "SO_REUSEADDR=1", NULL);
+
ip_addr = interpret_addr2(my_address);
ZERO_STRUCT(my_addr);