From: Philipp Tölke Date: Sun, 3 Oct 2010 17:24:26 +0000 (+0000) Subject: -Stop the vpn-helper if an invalid message arrives X-Git-Tag: initial-import-from-subversion-38251~20203 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=12b9ea4eebe332f034e1de8bacfc688b6fc7f0d4;p=oweals%2Fgnunet.git -Stop the vpn-helper if an invalid message arrives -Note that restarting the helper demands restarting the hijacker, too --- 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) {