From 12b9ea4eebe332f034e1de8bacfc688b6fc7f0d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philipp=20T=C3=B6lke?= Date: Sun, 3 Oct 2010 17:24:26 +0000 Subject: [PATCH] -Stop the vpn-helper if an invalid message arrives -Note that restarting the helper demands restarting the hijacker, too --- src/vpn/gnunet-daemon-vpn.c | 2 ++ src/vpn/gnunet-helper-vpn.c | 1 + 2 files changed, 3 insertions(+) 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* PLIBC_KILL(mycls.helper_pid, SIGKILL); GNUNET_OS_process_wait(mycls.helper_pid); + // 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 + GNUNET_DISK_pipe_close(mycls.helper_in); GNUNET_DISK_pipe_close(mycls.helper_out); 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: wri=0; goto outer; } + if(pkt->hdr.type != ntohs(GNUNET_MESSAGE_TYPE_VPN_HELPER)) abort(); while (r < ntohs(pkt->hdr.size)) { int t = read(0, buf + r, ntohs(pkt->hdr.size) - r); if (r < 0) { -- 2.25.1