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:
parent
f8cd781ecc
commit
d992e204c3
15
dhcpd.c
15
dhcpd.c
@ -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. */
|
||||||
|
@ -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. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user