ndp: deregister netlink event socket for non recoverable errors
[project/odhcpd.git] / src / odhcpd.c
index 22a27a4..ed96178 100644 (file)
@@ -63,8 +63,8 @@ static void print_usage(const char *app)
 {
        printf(
        "== %s Usage ==\n\n"
-        "  -h, --help   Print this help\n"
-        "  -l level     Specify log level 0..7 (default %d)\n",
+       "  -h, --help   Print this help\n"
+       "  -l level     Specify log level 0..7 (default %d)\n",
                app, LOG_WARNING
        );
 }
@@ -566,6 +566,12 @@ int odhcpd_register(struct odhcpd_event *event)
                        ((event->handle_error) ? ULOOP_ERROR_CB : 0));
 }
 
+int odhcpd_deregister(struct odhcpd_event *event)
+{
+       event->uloop.cb = NULL;
+       return uloop_fd_delete(&event->uloop);
+}
+
 void odhcpd_process(struct odhcpd_event *event)
 {
        odhcpd_receive_packets(&event->uloop, 0);