aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2010-07-30 23:35:25 +0000
committerPhilipp Tölke <toelke@in.tum.de>2010-07-30 23:35:25 +0000
commit096ec34ec77b2455cc4fd090ed093adfff413e36 (patch)
treebad9de6a2854e7b3809ab327792ba877ad25d095 /src
parente08568a24c162baab3366399cb9e6c31b8568f09 (diff)
downloadgnunet-096ec34ec77b2455cc4fd090ed093adfff413e36.tar.gz
gnunet-096ec34ec77b2455cc4fd090ed093adfff413e36.zip
If the tun-if can't be initialized correctly, close the vpn-helper
Diffstat (limited to 'src')
-rw-r--r--src/vpn/gnunet-daemon-vpn.c1
-rw-r--r--src/vpn/gnunet-helper-vpn.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index 0f5b3b06e..24f141cfc 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -78,6 +78,7 @@ static void start_helper_and_schedule(struct vpn_cls* mycls) {
78 78
79 79
80static void restart_helper(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) { 80static void restart_helper(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) {
81 // FIXME: Ratelimit this!
81 struct vpn_cls* mycls = (struct vpn_cls*) cls; 82 struct vpn_cls* mycls = (struct vpn_cls*) cls;
82 83
83 // Kill the helper 84 // Kill the helper
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