From 194e1c878aa383994fef0cbbb3449fdaa599b53a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 19 Apr 2014 22:03:07 +0200 Subject: Keep a vector of pollfds instead of regenerating it all the time --- src/tuntap.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/tuntap.c') 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 #include @@ -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."); } -- cgit v1.2.3