2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-29 05:17:57 +00:00

Allow interfaces to be specified on the command line

This commit is contained in:
Ted Lemon 1996-06-27 19:05:13 +00:00
parent f8cd781ecc
commit d992e204c3
2 changed files with 28 additions and 2 deletions

15
dhcpd.c
View File

@ -111,8 +111,21 @@ int main (argc, argv, envp)
server_port = htons (atoi (argv [i])); server_port = htons (atoi (argv [i]));
debug ("binding to user-specified port %d", debug ("binding to user-specified port %d",
ntohs (server_port)); ntohs (server_port));
} else } else if (argv [i][0] == '-') {
usage (); usage ();
} else {
struct interface_info *tmp =
((struct interface_info *)
dmalloc (sizeof *tmp, "get_interface_list"));
if (!tmp)
error ("Insufficient memory to %s %s",
"record interface", argv [i]);
memset (tmp, 0, sizeof *tmp);
strcpy (tmp -> name, argv [i]);
tmp -> next = interfaces;
tmp -> flags = INTERFACE_REQUESTED;
interfaces = tmp;
}
} }
/* Default to the DHCP/BOOTP port. */ /* Default to the DHCP/BOOTP port. */

View File

@ -111,8 +111,21 @@ int main (argc, argv, envp)
server_port = htons (atoi (argv [i])); server_port = htons (atoi (argv [i]));
debug ("binding to user-specified port %d", debug ("binding to user-specified port %d",
ntohs (server_port)); ntohs (server_port));
} else } else if (argv [i][0] == '-') {
usage (); usage ();
} else {
struct interface_info *tmp =
((struct interface_info *)
dmalloc (sizeof *tmp, "get_interface_list"));
if (!tmp)
error ("Insufficient memory to %s %s",
"record interface", argv [i]);
memset (tmp, 0, sizeof *tmp);
strcpy (tmp -> name, argv [i]);
tmp -> next = interfaces;
tmp -> flags = INTERFACE_REQUESTED;
interfaces = tmp;
}
} }
/* Default to the DHCP/BOOTP port. */ /* Default to the DHCP/BOOTP port. */