From d992e204c3140886e44b5312d7262b5e73b3a73d Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Thu, 27 Jun 1996 19:05:13 +0000 Subject: [PATCH] Allow interfaces to be specified on the command line --- dhcpd.c | 15 ++++++++++++++- server/dhcpd.c | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dhcpd.c b/dhcpd.c index 3d329dcf..91624073 100644 --- a/dhcpd.c +++ b/dhcpd.c @@ -111,8 +111,21 @@ int main (argc, argv, envp) server_port = htons (atoi (argv [i])); debug ("binding to user-specified port %d", ntohs (server_port)); - } else + } else if (argv [i][0] == '-') { 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. */ diff --git a/server/dhcpd.c b/server/dhcpd.c index 3d329dcf..91624073 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -111,8 +111,21 @@ int main (argc, argv, envp) server_port = htons (atoi (argv [i])); debug ("binding to user-specified port %d", ntohs (server_port)); - } else + } else if (argv [i][0] == '-') { 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. */