aboutsummaryrefslogtreecommitdiffstats
path: root/pingu_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'pingu_netlink.c')
-rw-r--r--pingu_netlink.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/pingu_netlink.c b/pingu_netlink.c
index f3ca952..4547670 100644
--- a/pingu_netlink.c
+++ b/pingu_netlink.c
@@ -637,7 +637,8 @@ static void netlink_read_cb(struct ev_loop *loop, struct ev_io *w, int revents)
static void netlink_close(struct ev_loop *loop, struct netlink_fd *fd)
{
if (fd->fd >= 0) {
- ev_io_stop(loop, &fd->io);
+ if (loop != NULL)
+ ev_io_stop(loop, &fd->io);
close(fd->fd);
fd->fd = 0;
}
@@ -737,3 +738,15 @@ err_close_all:
return FALSE;
}
+void kernel_cleanup_iface(struct pingu_iface *iface)
+{
+ netlink_rule_del(&talk_fd, iface);
+}
+
+void kernel_close(void)
+{
+ int i;
+ for (i = 0; i < ARRAY_SIZE(netlink_groups); i++)
+ netlink_close(NULL, &netlink_fds[i]);
+}
+