diff options
author | Philipp Tölke <toelke@in.tum.de> | 2010-10-03 17:24:26 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2010-10-03 17:24:26 +0000 |
commit | 12b9ea4eebe332f034e1de8bacfc688b6fc7f0d4 (patch) | |
tree | e8126053f0d8cc34b386d36db3973ffdfe0a3189 /src | |
parent | ea1b2ef20220e996cfc57a82e081370359e025cf (diff) | |
download | gnunet-12b9ea4eebe332f034e1de8bacfc688b6fc7f0d4.tar.gz gnunet-12b9ea4eebe332f034e1de8bacfc688b6fc7f0d4.zip |
-Stop the vpn-helper if an invalid message arrives
-Note that restarting the helper demands restarting the hijacker, too
Diffstat (limited to 'src')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn.c | 2 | ||||
-rw-r--r-- | src/vpn/gnunet-helper-vpn.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index 563a5186a..3e6e2c1be 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c | |||
@@ -99,6 +99,8 @@ static void restart_helper(void* cls, const struct GNUNET_SCHEDULER_TaskContext* | |||
99 | PLIBC_KILL(mycls.helper_pid, SIGKILL); | 99 | PLIBC_KILL(mycls.helper_pid, SIGKILL); |
100 | GNUNET_OS_process_wait(mycls.helper_pid); | 100 | GNUNET_OS_process_wait(mycls.helper_pid); |
101 | 101 | ||
102 | // FIXME: send msg to service-dns -- the hijacker has to be started again, too, the routing table is flushed if it depends on one interface | ||
103 | |||
102 | GNUNET_DISK_pipe_close(mycls.helper_in); | 104 | GNUNET_DISK_pipe_close(mycls.helper_in); |
103 | GNUNET_DISK_pipe_close(mycls.helper_out); | 105 | GNUNET_DISK_pipe_close(mycls.helper_out); |
104 | 106 | ||
diff --git a/src/vpn/gnunet-helper-vpn.c b/src/vpn/gnunet-helper-vpn.c index 459f2f491..4a367e9c9 100644 --- a/src/vpn/gnunet-helper-vpn.c +++ b/src/vpn/gnunet-helper-vpn.c | |||
@@ -221,6 +221,7 @@ outer: | |||
221 | wri=0; | 221 | wri=0; |
222 | goto outer; | 222 | goto outer; |
223 | } | 223 | } |
224 | if(pkt->hdr.type != ntohs(GNUNET_MESSAGE_TYPE_VPN_HELPER)) abort(); | ||
224 | while (r < ntohs(pkt->hdr.size)) { | 225 | while (r < ntohs(pkt->hdr.size)) { |
225 | int t = read(0, buf + r, ntohs(pkt->hdr.size) - r); | 226 | int t = read(0, buf + r, ntohs(pkt->hdr.size) - r); |
226 | if (r < 0) { | 227 | if (r < 0) { |