Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ CXXFLAGS+= \

LFLAGS+= \
-flto \
-lm \
`pkg-config --libs libnl-3.0`

ifeq ($(DEBUG),1)
Expand Down
1 change: 0 additions & 1 deletion block.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "block.h"

#include <errno.h>
#include <math.h>

#include "dhcp.h"
#include "logger.h"
Expand Down
5 changes: 3 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <arpa/inet.h>
#include <assert.h>
#include <getopt.h>
#include <math.h>
#include <netinet/in.h>
#include <sys/un.h>
#include <sys/types.h>
Expand Down Expand Up @@ -408,7 +407,8 @@ int main(int argc, char** argv) {
LOG("WARNING: Requested verbosity is higher than maximum supported by this build\n");
}

config.number_of_blocks = (uint32_t)pow(2u, (32u - config.prefix_len - ceil(log2(config.block_size))));
unsigned long number_of_addresses = 1ul << (32 - config.prefix_len);
config.number_of_blocks = (uint32_t)number_of_addresses / config.block_size;

if (config.disable_dhcp) {
config.spare_leases_needed = 0;
Expand All @@ -423,6 +423,7 @@ int main(int argc, char** argv) {
INFO("CONFIG: tentative_timeout=%i\n", config.tentative_timeout);
INFO("CONFIG: client_interface=%s\n", interface_client);
INFO("CONFIG: group_interface=%s\n", interface);
INFO("CONFIG: number_of_blocks=%lu\n", config.number_of_blocks);

//Register signal handlers
handle_signal(SIGHUP, SIG_IGN);
Expand Down