summaryrefslogtreecommitdiffstats
path: root/src/tuntap.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-19 22:03:07 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-19 22:03:07 +0200
commit194e1c878aa383994fef0cbbb3449fdaa599b53a (patch)
treefbb4ce72496c28659db2848c75edfbe8a59bc952 /src/tuntap.c
parent6798a76ffa1b4de4ec0ea07286c3510d86c0e3b6 (diff)
downloadfastd-194e1c878aa383994fef0cbbb3449fdaa599b53a.tar
fastd-194e1c878aa383994fef0cbbb3449fdaa599b53a.zip
Keep a vector of pollfds instead of regenerating it all the time
Diffstat (limited to 'src/tuntap.c')
-rw-r--r--src/tuntap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tuntap.c b/src/tuntap.c
index c75c281..d638611 100644
--- a/src/tuntap.c
+++ b/src/tuntap.c
@@ -25,6 +25,7 @@
#include "fastd.h"
+#include "poll.h"
#include <fcntl.h>
#include <net/if.h>
@@ -101,6 +102,8 @@ void fastd_tuntap_open(fastd_context_t *ctx) {
if (close(ctl_sock))
pr_error_errno(ctx, "close");
+ fastd_poll_set_fd_tuntap(ctx, ctx->tunfd);
+
pr_debug(ctx, "tun/tap device initialized.");
}
@@ -201,6 +204,8 @@ void fastd_tuntap_open(fastd_context_t *ctx) {
exit_bug(ctx, "invalid mode");
}
+ fastd_poll_set_fd_tuntap(ctx, ctx->tunfd);
+
pr_debug(ctx, "tun/tap device initialized.");
}
@@ -268,6 +273,8 @@ void fastd_tuntap_open(fastd_context_t *ctx) {
exit_bug(ctx, "invalid mode");
}
+ fastd_poll_set_fd_tuntap(ctx, ctx->tunfd);
+
pr_debug(ctx, "tun device initialized.");
}