summaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-01-19 09:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2011-01-19 09:14:03 +0000
commit60a1041f916d83c51800da45895eee029de31da6 (patch)
tree494d2bcd6c9888c5a101a51c5362dd36b597a6b7 /src/vpn
parentbfa3121cb08cab4930d85681b1c59fb3b36dc769 (diff)
byebye
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-helper-vpn.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/vpn/gnunet-helper-vpn.c b/src/vpn/gnunet-helper-vpn.c
index 6dc858f97..92e7d423e 100644
--- a/src/vpn/gnunet-helper-vpn.c
+++ b/src/vpn/gnunet-helper-vpn.c
@@ -56,13 +56,6 @@ struct in6_ifreq
#endif
-struct suid_packet
-{
- struct GNUNET_MessageHeader hdr;
- unsigned char data[1];
-}
-
-
/**
* Creates a tun-interface called dev;
* @param dev is asumed to point to a char[IFNAMSIZ]
@@ -305,7 +298,7 @@ outer:
if (FD_ISSET (0, &fds_r) && write_fd_possible)
{
write_fd_possible = 0;
- struct suid_packet *pkt = (struct suid_packet *) buf;
+ struct GNUNET_MessageHeader *pkt = ( struct GNUNET_MessageHeader *) buf;
tin = read (0, buf, sizeof (struct GNUNET_MessageHeader));
if (tin <= 0)
{
@@ -315,11 +308,11 @@ outer:
wri = 0;
goto outer;
}
- if (pkt->hdr.type != ntohs (GNUNET_MESSAGE_TYPE_VPN_HELPER))
+ if (pkt->type != ntohs (GNUNET_MESSAGE_TYPE_VPN_HELPER))
abort ();
- while (tin < ntohs (pkt->hdr.size))
+ while (tin < ntohs (pkt->size))
{
- ssize_t t = read (0, buf + tin, ntohs (pkt->hdr.size) - tin);
+ ssize_t t = read (0, buf + tin, ntohs (pkt->size) - tin);
if (t <= 0)
{
fprintf (stderr, "read-error: %s\n", strerror (errno));
@@ -332,11 +325,11 @@ outer:
}
tin = 0;
while (tin <
- ntohs (pkt->hdr.size) -
+ ntohs (pkt->size) -
sizeof (struct GNUNET_MessageHeader))
{
- ssize_t t = write (fd_tun, pkt->data,
- ntohs (pkt->hdr.size) -
+ ssize_t t = write (fd_tun, &pkt[1],
+ ntohs (pkt->size) -
sizeof (struct GNUNET_MessageHeader) - tin);
if (t <= 0)
{