/**
* If there are at least this many connections, old ones will be removed
*/
-static long long unsigned int max_connections;
+static unsigned long long max_connections;
/**
* This hashmaps saves interesting things about the configured UDP services
/* could be TCP or UDP, but both have the ports in the right
place, so that doesn't matter here */
udp = (const struct GNUNET_TUN_UdpHeader *) &ipv4[1];
- source_port = ntohs (udp->source_port);
- destination_port = ntohs (udp->destination_port);
+ /* swap ports, as they are from the original message */
+ destination_port = ntohs (udp->source_port);
+ source_port = ntohs (udp->destination_port);
/* throw away ICMP payload, won't be useful for the other side anyway */
pktlen = sizeof (struct GNUNET_TUN_IcmpHeader);
break;
/* could be TCP or UDP, but both have the ports in the right
place, so that doesn't matter here */
udp = (const struct GNUNET_TUN_UdpHeader *) &ipv6[1];
- source_port = ntohs (udp->source_port);
- destination_port = ntohs (udp->destination_port);
+ /* swap ports, as they are from the original message */
+ destination_port = ntohs (udp->source_port);
+ source_port = ntohs (udp->destination_port);
/* throw away ICMP payload, won't be useful for the other side anyway */
pktlen = sizeof (struct GNUNET_TUN_IcmpHeader);
break;
const void *source_ip)
{
struct TunnelState *state;
- char buf[pktlen];
+ char buf[pktlen] GNUNET_ALIGN;
struct GNUNET_TUN_TcpHeader *mtcp;
struct GNUNET_EXIT_TcpDataMessage *tdm;
struct TunnelMessageQueue *tnq;
return;
}
{
- char buf[len];
+ char buf[len] GNUNET_ALIGN;
struct GNUNET_MessageHeader *hdr;
struct GNUNET_TUN_Layer2PacketHeader *tun;
return;
}
{
- char buf[len];
+ char buf[len] GNUNET_ALIGN;
struct GNUNET_MessageHeader *hdr;
struct GNUNET_TUN_Layer2PacketHeader *tun;
const struct in_addr *v4;
const struct in6_addr *v6;
const void *payload;
- char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8];
+ char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8] GNUNET_ALIGN;
int af;
GNUNET_STATISTICS_update (stats,
const struct GNUNET_EXIT_IcmpServiceMessage *msg;
uint16_t pkt_len = ntohs (message->size);
struct GNUNET_TUN_IcmpHeader icmp;
- char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8];
+ char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8] GNUNET_ALIGN;
const void *payload;
GNUNET_STATISTICS_update (stats,
return;
}
{
- char buf[len];
+ char buf[len] GNUNET_ALIGN;
struct GNUNET_MessageHeader *hdr;
struct GNUNET_TUN_Layer2PacketHeader *tun;
if (GNUNET_YES !=
GNUNET_OS_check_helper_binary ("gnunet-helper-exit"))
{
- fprintf (stderr,
- "`%s' is not SUID, refusing to run.\n",
- "gnunet-helper-exit");
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("`%s' must be installed SUID, refusing to run\n"),
+ "gnunet-helper-exit");
global_ret = 1;
return;
}