(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));
(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 =
*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));
}
}
(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));
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) -
*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));
}
{
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
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;