summaryrefslogtreecommitdiffstats
path: root/source/libsmb/namequery.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-15 21:22:20 +0000
committerJeremy Allison <jra@samba.org>2001-04-15 21:22:20 +0000
commite0572b20256e71b12a80e420e7499633b9a0a1fa (patch)
tree6854da6e35151051a8f59cb63d5284bcb2f590ba /source/libsmb/namequery.c
parent453bf9c53fb78c5303425c46b5ff191f6994813e (diff)
downloadsamba-e0572b20256e71b12a80e420e7499633b9a0a1fa.tar.gz
samba-e0572b20256e71b12a80e420e7499633b9a0a1fa.tar.xz
samba-e0572b20256e71b12a80e420e7499633b9a0a1fa.zip
Fix from "Darrin B. Jewell" <jewell@bdi.com> to allow anything other than
nmbd to talk to nmbd if it's a WINS server. Jeremy.
Diffstat (limited to 'source/libsmb/namequery.c')
-rw-r--r--source/libsmb/namequery.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c
index fbc1e3aee54..816804753e7 100644
--- a/source/libsmb/namequery.c
+++ b/source/libsmb/namequery.c
@@ -525,14 +525,22 @@ static BOOL resolve_wins(const char *name, int name_type,
DEBUG(3,("resolve_wins: Attempting wins lookup for name %s<0x%x>\n", name, name_type));
- if( wins_srv_count() < 1 ) {
+ if (lp_wins_support()) {
+ /*
+ * We're providing WINS support. Call ourselves so
+ * long as we're not nmbd.
+ */
+ extern struct in_addr loopback_ip;
+ wins_ip = loopback_ip;
+ wins_ismyip = True;
+ } else if( wins_srv_count() < 1 ) {
DEBUG(3,("resolve_wins: WINS server resolution selected and no WINS servers listed.\n"));
return False;
+ } else {
+ wins_ip = wins_srv_ip();
+ wins_ismyip = ismyip(wins_ip);
}
- wins_ip = wins_srv_ip();
- wins_ismyip = ismyip(wins_ip);
-
DEBUG(3, ("resolve_wins: WINS server == <%s>\n", inet_ntoa(wins_ip)) );
if((wins_ismyip && !global_in_nmbd) || !wins_ismyip) {
sock = open_socket_in( SOCK_DGRAM, 0, 3,