1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Simple cleanup, but I also changed the value of the dlevel parameter passed

to open_socket_in() from within the open_sockets() function.  This has some
effect on the way port numbers are assigned.  Basically, if we use the -r
switch we are saying 'use port 137'.  If we can't do that, there should
be an error message and a failure.  If we don't use -r then we simply select
the first available port.  The way it was working, if we selected -r and
port 137 was in use, wierd things would happen as open_socket_in() tried to
find another port.
(This used to be commit f09cb41ad8)
This commit is contained in:
Christopher R. Hertel 2000-10-11 16:24:20 +00:00
parent 9a872fb616
commit 2cddf134e6

View File

@ -34,7 +34,7 @@ static struct in_addr bcast_addr;
static BOOL recursion_desired = False;
static BOOL translate_addresses = False;
static int ServerFD= -1;
static int RootPort = 0;
static int RootPort = False;
static BOOL find_status=False;
/****************************************************************************
@ -43,14 +43,14 @@ static BOOL find_status=False;
static BOOL open_sockets(void)
{
ServerFD = open_socket_in( SOCK_DGRAM,
(RootPort ? 137 :0),
3,
(RootPort ? 137 : 0),
(RootPort ? 0 : 3),
interpret_addr(lp_socket_address()), True );
if (ServerFD == -1)
return(False);
set_socket_options(ServerFD,"SO_BROADCAST");
set_socket_options( ServerFD, "SO_BROADCAST" );
DEBUG(3, ("Socket opened.\n"));
return True;
@ -200,7 +200,7 @@ int main(int argc,char *argv[])
pstrcpy(servicesf, optarg);
break;
case 'r':
RootPort = -1;
RootPort = True;
break;
case 'h':
usage();