authentication of ciphertexts (+ seed)
[oweals/gnunet.git] / src / vpn / gnunet-helper-vpn.c
index 3f9bcb3d4173370f19c6e22462f0ee050de89ba9..4a367e9c9af87809a5d80b80e0be5aaf208139a5 100644 (file)
@@ -156,8 +156,6 @@ int main(int argc, char** argv) {
                exit(1);
        }
 
-       fprintf(stderr, "Initialized the interface %s as %d.\n", dev, fd_tun);
-
        {
        // TODO: get this out of argv
        char address[] = "1234::1";
@@ -175,7 +173,7 @@ int main(int argc, char** argv) {
 
        uid_t uid = getuid ();
        if (setresuid (uid, uid, uid) != 0 )
-               fprintf (stderr, "Failed to setresuid: %m\n");
+               fprintf (stderr, "Failed to setresuid: %s\n", strerror(errno));
 
        setnonblocking(0);
        setnonblocking(1);
@@ -223,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) {
@@ -283,7 +282,6 @@ outer:
                        }
                }
        }
-       fprintf(stderr, "Quitting!\n");
 
        close(fd_tun);