diff options
author | Philipp Tölke <toelke@in.tum.de> | 2010-07-30 23:35:25 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2010-07-30 23:35:25 +0000 |
commit | 096ec34ec77b2455cc4fd090ed093adfff413e36 (patch) | |
tree | bad9de6a2854e7b3809ab327792ba877ad25d095 /src/vpn/gnunet-helper-vpn.c | |
parent | e08568a24c162baab3366399cb9e6c31b8568f09 (diff) | |
download | gnunet-096ec34ec77b2455cc4fd090ed093adfff413e36.tar.gz gnunet-096ec34ec77b2455cc4fd090ed093adfff413e36.zip |
If the tun-if can't be initialized correctly, close the vpn-helper
Diffstat (limited to 'src/vpn/gnunet-helper-vpn.c')
-rw-r--r-- | src/vpn/gnunet-helper-vpn.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vpn/gnunet-helper-vpn.c b/src/vpn/gnunet-helper-vpn.c index 4a75182f9..83c0af453 100644 --- a/src/vpn/gnunet-helper-vpn.c +++ b/src/vpn/gnunet-helper-vpn.c | |||
@@ -122,6 +122,12 @@ int main(int argc, char** argv) { | |||
122 | signal(SIGTERM, &term); | 122 | signal(SIGTERM, &term); |
123 | 123 | ||
124 | int fd_tun = init_tun(dev); | 124 | int fd_tun = init_tun(dev); |
125 | |||
126 | if (fd_tun < 0) { | ||
127 | fprintf(stderr, "Could not initialize tun-interface: %m\n"); | ||
128 | exit(1); | ||
129 | } | ||
130 | |||
125 | fprintf(stderr, "Initialized the interface %s as %d.\n", dev, fd_tun); | 131 | fprintf(stderr, "Initialized the interface %s as %d.\n", dev, fd_tun); |
126 | 132 | ||
127 | // TODO: get this out of argv | 133 | // TODO: get this out of argv |