-Stop the vpn-helper if an invalid message arrives
authorPhilipp Tölke <toelke@in.tum.de>
Sun, 3 Oct 2010 17:24:26 +0000 (17:24 +0000)
committerPhilipp Tölke <toelke@in.tum.de>
Sun, 3 Oct 2010 17:24:26 +0000 (17:24 +0000)
-Note that restarting the helper demands restarting the hijacker, too

src/vpn/gnunet-daemon-vpn.c
src/vpn/gnunet-helper-vpn.c

index 563a5186abd5751938a4004bc8fffd1274ab6f3c..3e6e2c1beb9dc0f8b84f51d090f09613b9ccd932 100644 (file)
@@ -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);
 
index 459f2f4913df9175cdb0654cb60c389971683e48..4a367e9c9af87809a5d80b80e0be5aaf208139a5 100644 (file)
@@ -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) {