[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16929 - gnunet/src/vpn
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16929 - gnunet/src/vpn |
Date: |
Sun, 18 Sep 2011 13:59:13 +0200 |
Author: toelke
Date: 2011-09-18 13:59:13 +0200 (Sun, 18 Sep 2011)
New Revision: 16929
Modified:
gnunet/src/vpn/gnunet-daemon-vpn-helper.c
gnunet/src/vpn/gnunet-daemon-vpn.c
Log:
fix bug in -vpn
Modified: gnunet/src/vpn/gnunet-daemon-vpn-helper.c
===================================================================
--- gnunet/src/vpn/gnunet-daemon-vpn-helper.c 2011-09-18 11:59:11 UTC (rev
16928)
+++ gnunet/src/vpn/gnunet-daemon-vpn-helper.c 2011-09-18 11:59:13 UTC (rev
16929)
@@ -296,7 +296,7 @@
(port_in_ports (me->desc.ports, pkt6_udp->udp_hdr.dpt) ||
testBit (me->additional_ports, ntohs (pkt6_udp->udp_hdr.dpt))))
{
- hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP);
+ hdr->type = htons (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP);
memcpy (hc + 1, &pkt6_udp->udp_hdr, ntohs (pkt6_udp->udp_hdr.len));
@@ -305,11 +305,16 @@
(me->desc.service_type & htonl
(GNUNET_DNS_SERVICE_TYPE_TCP))
&& (port_in_ports (me->desc.ports, pkt6_tcp->tcp_hdr.dpt)))
{
- hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP);
+ hdr->type = htons (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP);
memcpy (hc + 1, &pkt6_tcp->tcp_hdr, ntohs (pkt6->ip6_hdr.paylgth));
}
+ else
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "pip: %d\n",
port_in_ports(me->desc.ports, pkt6_tcp->tcp_hdr.dpt));
+ GNUNET_assert(0);
+ }
if (me->tunnel == NULL && NULL != cls)
{
*cls =
@@ -328,7 +333,7 @@
*cls = me->tunnel;
send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Queued to send to peer %x, type %d\n",
+ "Queued to send IPv6 to peer %x, type %d\n",
*((unsigned int *) &me->desc.peer), ntohs (hdr->type));
}
}
@@ -495,7 +500,7 @@
(port_in_ports (me->desc.ports, pkt_udp->udp_hdr.dpt) ||
testBit (me->additional_ports, ntohs (pkt_udp->udp_hdr.dpt))))
{
- hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP);
+ hdr->type = htons (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP);
memcpy (hc + 1, &pkt_udp->udp_hdr, ntohs (pkt_udp->udp_hdr.len));
@@ -505,7 +510,7 @@
desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP))
&& (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt)))
{
- hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP);
+ hdr->type = htons (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP);
memcpy (hc + 1, &pkt_tcp->tcp_hdr,
ntohs (pkt->ip_hdr.tot_lngth) -
@@ -530,7 +535,7 @@
*cls = me->tunnel;
send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Queued to send to peer %x, type %d\n",
+ "Queued to send IPv4 to peer %x, type %d\n",
*((unsigned int *) &me->desc.peer),
ntohs (hdr->type));
}
Modified: gnunet/src/vpn/gnunet-daemon-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-daemon-vpn.c 2011-09-18 11:59:11 UTC (rev 16928)
+++ gnunet/src/vpn/gnunet-daemon-vpn.c 2011-09-18 11:59:13 UTC (rev 16929)
@@ -329,7 +329,7 @@
{
uint16_t *ps = (uint16_t *) & ports;
- return ps[0] == port || ps[1] == port || ps[2] == port || ps[3] == port;
+ return ports == 0 || ps[0] == port || ps[1] == port || ps[2] == port ||
ps[3] == port;
}
void
@@ -1056,7 +1056,10 @@
ntohs (message->size) - sizeof (struct GNUNET_MessageHeader) -
sizeof (GNUNET_HashCode);
- if (s->addrlen == 16)
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet back, addrlen =
%d\n", s->addrlen);
+
+ if (ntohs(message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP_BACK ||
+ s->addrlen == 16)
{
size_t size = pktlen + sizeof (struct ip6_tcp) - 1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16929 - gnunet/src/vpn,
gnunet <=