summaryrefslogtreecommitdiff
path: root/source3/utils/nmblookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/nmblookup.c')
-rw-r--r--source3/utils/nmblookup.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index 23415a0ca6..f920106f75 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/utils/nmblookup.c
@@ -33,24 +33,28 @@ extern struct in_addr ipzero;
int ServerFD= -1;
-int RootPort = 0;
+BOOL RootPort = False;
/****************************************************************************
open the socket communication
**************************************************************************/
static BOOL open_sockets(void)
{
- ServerFD = open_socket_in( SOCK_DGRAM,
- (RootPort ? 137 :0),
- 3,
- interpret_addr(lp_socket_address()) );
-
- if (ServerFD == -1)
- return(False);
-
- set_socket_options(ServerFD,"SO_BROADCAST");
+ if (RootPort)
+ {
+ ServerFD = open_socket_in( SOCK_DGRAM,
+ 137,
+ 3,
+ interpret_addr(lp_socket_address()) );
+
+ if (ServerFD == -1)
+ {
+ return(False);
+ }
+ set_socket_options(ServerFD,"SO_BROADCAST");
DEBUG(3, ("Socket opened.\n"));
+ }
return True;
}
@@ -152,7 +156,7 @@ int main(int argc,char *argv[])
pstrcpy(servicesf, optarg);
break;
case 'r':
- RootPort = -1;
+ RootPort = True;
break;
case 'h':
usage();