diff options
author | Steven Barth <steven@midlink.org> | 2014-10-17 13:14:47 +0200 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-10-17 13:14:47 +0200 |
commit | ff9d2a001bea612cad05d9d317f0f0ca555aa72f (patch) | |
tree | 0b5f384019cdb2933cad17a72785b32566a0ca0a /src/odhcpd.c | |
parent | b4fe0fbfe452e503e689104f093ee32875bc48d3 (diff) |
ndp: more fixes
Diffstat (limited to 'src/odhcpd.c')
-rw-r--r-- | src/odhcpd.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/odhcpd.c b/src/odhcpd.c index b8651dd..0edf63e 100644 --- a/src/odhcpd.c +++ b/src/odhcpd.c @@ -49,6 +49,12 @@ static int rtnl_seq = 0; static int urandom_fd = -1; +static void sighandler(_unused int signal) +{ + uloop_end(); +} + + int main() { openlog("odhcpd", LOG_PERROR | LOG_PID, LOG_DAEMON); @@ -71,6 +77,8 @@ int main() return 4; signal(SIGUSR1, SIG_IGN); + signal(SIGINT, sighandler); + signal(SIGTERM, sighandler); if (init_router()) return 4; @@ -377,6 +385,11 @@ int odhcpd_register(struct odhcpd_event *event) return uloop_fd_add(&event->uloop, ULOOP_READ); } +void odhcpd_process(struct odhcpd_event *event) +{ + odhcpd_receive_packets(&event->uloop, 0); +} + void odhcpd_urandom(void *data, size_t len) { read(urandom_fd, data, len); |