]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Allow interfaces to be specified on the command line
authorTed Lemon <source@isc.org>
Thu, 27 Jun 1996 19:05:13 +0000 (19:05 +0000)
committerTed Lemon <source@isc.org>
Thu, 27 Jun 1996 19:05:13 +0000 (19:05 +0000)
dhcpd.c
server/dhcpd.c

diff --git a/dhcpd.c b/dhcpd.c
index 3d329dcfce354711f1d3a702ee4e1b459605a540..916240737fd4b79dda919339c85efe75320b6557 100644 (file)
--- 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. */
index 3d329dcfce354711f1d3a702ee4e1b459605a540..916240737fd4b79dda919339c85efe75320b6557 100644 (file)
@@ -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. */