summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-10-07 11:06:34 +0000
committerAndrew Tridgell <tridge@samba.org>1996-10-07 11:06:34 +0000
commitdfa2b456c743a643080d3a2eb0d9db62503141f5 (patch)
tree9ef3ba3fb4bc2fd73d21e621dc72a5c41954086e /source3/utils
parent8781e4d787763a6b50d7b3819b33ace208ff7784 (diff)
downloadsamba-dfa2b456c743a643080d3a2eb0d9db62503141f5.tar.gz
samba-dfa2b456c743a643080d3a2eb0d9db62503141f5.tar.bz2
samba-dfa2b456c743a643080d3a2eb0d9db62503141f5.zip
- continue when failing to load config file in nmblookup and smbclient
- fix important bug in nmbd where it set the return code for a negative name response to 0 (which means success!) (This used to be commit bfa816cc8f30d9a629b4fe9f71bf0707aa6c4502)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/nmblookup.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index c137b4f93a..ccdbec45e6 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/utils/nmblookup.c
@@ -101,6 +101,8 @@ int main(int argc,char *argv[])
BOOL find_status=False;
int i;
static pstring servicesf = CONFIGFILE;
+ struct in_addr bcast_addr;
+ BOOL got_bcast = False;
DEBUGLEVEL = 1;
*lookup = 0;
@@ -116,6 +118,8 @@ int main(int argc,char *argv[])
{
case 'B':
iface_set_default(NULL,optarg,NULL);
+ bcast_addr = *interpret_addr2(optarg);
+ got_bcast = True;
break;
case 'i':
strcpy(scope,optarg);
@@ -149,14 +153,16 @@ int main(int argc,char *argv[])
if (!lp_load(servicesf,True)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
- return (-1);
}
load_interfaces();
init_structs();
if (!open_sockets()) return(1);
- DEBUG(1,("Sending queries to %s\n",inet_ntoa(*iface_bcast(ipzero))));
+ if (!got_bcast)
+ bcast_addr = *iface_bcast(ipzero);
+
+ DEBUG(1,("Sending queries to %s\n",inet_ntoa(bcast_addr)));
for (i=optind;i<argc;i++)
@@ -187,7 +193,7 @@ int main(int argc,char *argv[])
}
if (name_query(ServerFD,lookup,lookup_type,bcast,True,
- *iface_bcast(ipzero),&ip,NULL))
+ bcast_addr,&ip,NULL))
{
printf("%s %s\n",inet_ntoa(ip),lookup);
}