diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-12-28 04:55:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:47:53 -0500 |
commit | df00f8b3428c6d1254e66275c90ae4025cb52c47 (patch) | |
tree | f8ee3c5744a07378fa19ff6244fcac8e27c5332d /source/nbt_server/wins/winsserver.c | |
parent | 2f54d7f774434f2a8b89ae01e993c4a1d16ce861 (diff) | |
download | samba-df00f8b3428c6d1254e66275c90ae4025cb52c47.tar.gz |
r12535: - simplify string list handling in a couple of places using str_list_add()
- don't reply with 127.0.0.1 in NBT or WINS name queries unless the
query came in on the loopback interface. Otherwise clients can end
up talking to themselves, which is not very productive :-)
Diffstat (limited to 'source/nbt_server/wins/winsserver.c')
-rw-r--r-- | source/nbt_server/wins/winsserver.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/nbt_server/wins/winsserver.c b/source/nbt_server/wins/winsserver.c index 78bf0bd1414..44842c7542a 100644 --- a/source/nbt_server/wins/winsserver.c +++ b/source/nbt_server/wins/winsserver.c @@ -370,6 +370,14 @@ static void nbtd_winsserver_query(struct nbt_name_socket *nbtsock, if (!addresses) { goto notfound; } + + /* if the query didn't come from loopback, then never give out + loopback in the reply, as loopback means something + different for the recipient than for us */ + if (strcmp(src->addr, "127.0.0.1") != 0) { + str_list_remove(addresses, "127.0.0.1"); + } + found: nbtd_name_query_reply(nbtsock, packet, src, name, 0, nb_flags, addresses); |