aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r--networking/udhcp/dhcpd.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 62057bed8..0935a9453 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -10,29 +10,9 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/wait.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <time.h>
-
+#include "common.h"
#include "dhcpd.h"
-#include "arpping.h"
-#include "socket.h"
#include "options.h"
-#include "files.h"
-#include "serverpacket.h"
-#include "common.h"
-#include "signalpipe.h"
-#include "static_leases.h"
/* globals */
@@ -86,7 +66,7 @@ int udhcpd_main(int argc, char *argv[])
udhcp_sp_setup();
timeout_end = time(0) + server_config.auto_time;
- while(1) { /* loop until universe collapses */
+ while (1) { /* loop until universe collapses */
if (server_socket < 0)
if ((server_socket = listen_socket(INADDR_ANY, SERVER_PORT, server_config.interface)) < 0) {
@@ -144,8 +124,7 @@ int udhcpd_main(int argc, char *argv[])
/* Look for a static lease */
static_lease_ip = getIpByMac(server_config.static_leases, &packet.chaddr);
- if(static_lease_ip)
- {
+ if (static_lease_ip) {
bb_info_msg("Found static lease: %x", static_lease_ip);
memcpy(&static_lease.chaddr, &packet.chaddr, 16);
@@ -154,10 +133,8 @@ int udhcpd_main(int argc, char *argv[])
lease = &static_lease;
- }
- else
- {
- lease = find_lease_by_chaddr(packet.chaddr);
+ } else {
+ lease = find_lease_by_chaddr(packet.chaddr);
}
switch (state[0]) {
@@ -245,4 +222,3 @@ int udhcpd_main(int argc, char *argv[])
return 0;
}
-