diff --git a/Makefile b/Makefile index 528f607..2e73c38 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ ifdef DEBUG CCFLAGS ?= -g -DDEBUG else CCFLAGS ?= -Os +LDFLAGS ?= -s -w endif PREFIX ?= /usr/local diff --git a/README.md b/README.md index 420db83..f0eb6dc 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Please read the manpages [ndppd.conf.5](ndppd.conf.5.adoc) and [ndppd.8](ndppd.8 - [x] EPOLL support - [x] rtnetlink: Tracking routes - [x] rtnetlink: Tracking local addresses -- [ ] rtnetlink: Memory cleanup +- [x] rtnetlink: Cleanup - [ ] rtnetlink: Managing routes - [x] Automatic detection of internal interfaces (auto) - [ ] Automatically managing routes (autowire) diff --git a/src/conf.c b/src/conf.c index 7e64b20..c8630a7 100644 --- a/src/conf.c +++ b/src/conf.c @@ -520,7 +520,7 @@ bool nd_conf_load(const char *path) if (fp == NULL) { - nd_log_error("Failed to load configuration (%s): %s", path, strerror(errno)); + nd_log_error("Failed to load configuration: %s", strerror(errno)); return NULL; } diff --git a/src/io.c b/src/io.c index f790ced..f592b2c 100644 --- a/src/io.c +++ b/src/io.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/src/io.h b/src/io.h index 27e4c8d..81d13e4 100644 --- a/src/io.h +++ b/src/io.h @@ -31,10 +31,8 @@ struct nd_io nd_io_handler_t *handler; }; -nd_io_t *nd_sio_create(int fd); -bool nd_sio_set_nonblock(nd_io_t *io, bool value); - nd_io_t *nd_io_socket(int domain, int type, int protocol); +nd_io_t *nd_io_open(const char *file, int oflag); void nd_io_close(nd_io_t *io); bool nd_io_bind(nd_io_t *io, const struct sockaddr *addr, size_t addrlen); ssize_t nd_io_send(nd_io_t *io, const struct sockaddr *addr, size_t addrlen, const void *msg, size_t msglen); diff --git a/src/ndppd.c b/src/ndppd.c index 7f70942..25073d8 100644 --- a/src/ndppd.c +++ b/src/ndppd.c @@ -191,10 +191,7 @@ int main(int argc, char *argv[]) nd_log_info("Loading configuration \"%s\"...", nd_opt_config_path); if (!nd_conf_load(nd_opt_config_path)) - { - nd_log_error("Failed to load configuration"); return -1; - } if (!nd_iface_startup()) return -1; @@ -212,7 +209,6 @@ int main(int argc, char *argv[]) bool query_addresses = false; - while (1) { if (nd_current_time >= nd_rtnl_dump_timeout)