summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-03-23 02:39:41 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-03-23 02:39:41 +0100
commit6dbb8e041cd07b76712bec54d3fcd974a591c620 (patch)
tree563322c8dc8bb0dbe1446da5c8cfa88b49bf07f1 /src/fastd.c
parent0e8493ea17c1bba64ee0de588bdbad7fdb6fd9ba (diff)
downloadfastd-6dbb8e041cd07b76712bec54d3fcd974a591c620.tar
fastd-6dbb8e041cd07b76712bec54d3fcd974a591c620.zip
iface: make fastd_iface_open() gracefully (at least on Linux, for now)
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fastd.c b/src/fastd.c
index 6ab07be..ecef0fb 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -500,8 +500,11 @@ static inline void init(int argc, char *argv[]) {
fastd_on_pre_up();
- if (conf.mode == MODE_TAP)
+ if (conf.mode == MODE_TAP) {
ctx.iface = fastd_iface_open(NULL);
+ if (!ctx.iface)
+ exit(1); /* An error message has already been printed by fastd_iface_open() */
+ }
/* change groups before trying to write the PID file as they can be relevant for file access */
set_groups();