summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>2000-07-19 05:32:43 +0000
committerChristopher R. Hertel <crh@samba.org>2000-07-19 05:32:43 +0000
commit3c9e410c340d53897a3f97243d8286812704f6c0 (patch)
tree4198a4ba079626201d4fec3ce29f680b65331596 /source3/nsswitch
parentb35f21fb3a19417e2aab82a573ff121a086b224c (diff)
downloadsamba-3c9e410c340d53897a3f97243d8286812704f6c0.tar.gz
samba-3c9e410c340d53897a3f97243d8286812704f6c0.tar.bz2
samba-3c9e410c340d53897a3f97243d8286812704f6c0.zip
Instead of handing back a string (which might be a DNS name or an IP
string), the wins_srv module now hands back a struct in_addr when it's called. It caches the IP address once it has been looked up. The IP is cleared (and must be looked up again) if the 'wins server' parameter is reread, or if the node is marked 'dead'. A dead node will not be re-tried for 10 minutes (per a #define in wins_srv.c). As it was, the code was reading the WINS server name or IP directly from lp_wins_server. That's okay, except that if the value was expressed as a name, then a DNS lookup would be done every time the client wanted to talk to the server. I still need to work out the implications of failover regarding the 'unicast subnet' list. Chris -)----- (This used to be commit 73aa188320fd3bf10b5dfc057323f40aff2c13bd)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wins.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/nsswitch/wins.c b/source3/nsswitch/wins.c
index 41b71c64bb..ca0f22e3a6 100644
--- a/source3/nsswitch/wins.c
+++ b/source3/nsswitch/wins.c
@@ -36,7 +36,6 @@ struct in_addr *lookup_backend(const char *name, int *count)
int fd;
static int initialised;
struct in_addr *ret;
- char *p;
int j;
if (!initialised) {
@@ -56,9 +55,8 @@ struct in_addr *lookup_backend(const char *name, int *count)
set_socket_options(fd,"SO_BROADCAST");
- p = wins_srv();
- if (p && *p) {
- ret = name_query(fd,name,0x20,False,True, *interpret_addr2(p), count);
+ if( !zero_ip( wins_ip ) ) {
+ ret = name_query( fd, name, 0x20, False, True, wins_src_ip(), count );
goto out;
}