projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- implementation for mantis 0002485
[oweals/gnunet.git]
/
src
/
dns
/
gnunet-service-dns.c
diff --git
a/src/dns/gnunet-service-dns.c
b/src/dns/gnunet-service-dns.c
index 1fc201ff97eea6013547a31e608921bcdd7dae04..6337538d10a9a8f83886772df29a606c38e7634c 100644
(file)
--- a/
src/dns/gnunet-service-dns.c
+++ b/
src/dns/gnunet-service-dns.c
@@
-540,7
+540,7
@@
request_done (struct RequestRecord *rr)
return;
}
{
return;
}
{
- char buf[reply_len];
+ char buf[reply_len]
GNUNET_ALIGN
;
size_t off;
struct GNUNET_TUN_IPv4Header ip4;
struct GNUNET_TUN_IPv6Header ip6;
size_t off;
struct GNUNET_TUN_IPv4Header ip4;
struct GNUNET_TUN_IPv6Header ip6;
@@
-631,10
+631,10
@@
request_done (struct RequestRecord *rr)
}
/* final checks & sending */
GNUNET_assert (off == reply_len);
}
/* final checks & sending */
GNUNET_assert (off == reply_len);
- GNUNET_HELPER_send (hijacker,
- hdr,
- GNUNET_YES,
- NULL, NULL);
+
(void)
GNUNET_HELPER_send (hijacker,
+
hdr,
+
GNUNET_YES,
+
NULL, NULL);
GNUNET_STATISTICS_update (stats,
gettext_noop ("# DNS requests answered via TUN interface"),
1, GNUNET_NO);
GNUNET_STATISTICS_update (stats,
gettext_noop ("# DNS requests answered via TUN interface"),
1, GNUNET_NO);
@@
-655,7
+655,7
@@
static void
send_request_to_client (struct RequestRecord *rr,
struct GNUNET_SERVER_Client *client)
{
send_request_to_client (struct RequestRecord *rr,
struct GNUNET_SERVER_Client *client)
{
- char buf[sizeof (struct GNUNET_DNS_Request) + rr->payload_length];
+ char buf[sizeof (struct GNUNET_DNS_Request) + rr->payload_length]
GNUNET_ALIGN
;
struct GNUNET_DNS_Request *req;
if (sizeof (buf) >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
struct GNUNET_DNS_Request *req;
if (sizeof (buf) >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
@@
-986,7
+986,7
@@
do_dns_read (struct GNUNET_NETWORK_Handle *dnsout)
#endif
{
#endif
{
- unsigned char buf[len];
+ unsigned char buf[len]
GNUNET_ALIGN
;
addrlen = sizeof (addr);
memset (&addr, 0, sizeof (addr));
addrlen = sizeof (addr);
memset (&addr, 0, sizeof (addr));
@@
-1196,10
+1196,8
@@
handle_client_response (void *cls GNUNET_UNUSED,
return;
}
GNUNET_free_non_null (rr->payload);
return;
}
GNUNET_free_non_null (rr->payload);
-#if DEBUG_DNS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- _("Changing DNS reply according to client specifications\n"));
-#endif
+ "Changing DNS reply according to client specifications\n");
rr->payload = GNUNET_malloc (msize);
rr->payload_length = msize;
memcpy (rr->payload, &resp[1], msize);
rr->payload = GNUNET_malloc (msize);
rr->payload_length = msize;
memcpy (rr->payload, &resp[1], msize);
@@
-1241,7
+1239,7
@@
handle_client_response (void *cls GNUNET_UNUSED,
* @param client identification of the client
* @param message the actual message, a DNS request we should handle
*/
* @param client identification of the client
* @param message the actual message, a DNS request we should handle
*/
-static
void
+static
int
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
const struct GNUNET_MessageHeader *message)
{
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
const struct GNUNET_MessageHeader *message)
{
@@
-1262,7
+1260,7
@@
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
{
/* non-IP packet received on TUN!? */
GNUNET_break (0);
{
/* non-IP packet received on TUN!? */
GNUNET_break (0);
- return;
+ return
GNUNET_OK
;
}
msize -= sizeof (struct GNUNET_MessageHeader);
tun = (const struct GNUNET_TUN_Layer2PacketHeader *) &message[1];
}
msize -= sizeof (struct GNUNET_MessageHeader);
tun = (const struct GNUNET_TUN_Layer2PacketHeader *) &message[1];
@@
-1281,7
+1279,7
@@
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
/* non-IP/UDP packet received on TUN (or with options) */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received malformed IPv4-UDP packet on TUN interface.\n"));
/* non-IP/UDP packet received on TUN (or with options) */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received malformed IPv4-UDP packet on TUN interface.\n"));
- return;
+ return
GNUNET_OK
;
}
udp = (const struct GNUNET_TUN_UdpHeader*) &ip4[1];
msize -= sizeof (struct GNUNET_TUN_IPv4Header);
}
udp = (const struct GNUNET_TUN_UdpHeader*) &ip4[1];
msize -= sizeof (struct GNUNET_TUN_IPv4Header);
@@
-1297,7
+1295,7
@@
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
/* non-IP/UDP packet received on TUN (or with extensions) */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received malformed IPv6-UDP packet on TUN interface.\n"));
/* non-IP/UDP packet received on TUN (or with extensions) */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received malformed IPv6-UDP packet on TUN interface.\n"));
- return;
+ return
GNUNET_OK
;
}
udp = (const struct GNUNET_TUN_UdpHeader*) &ip6[1];
msize -= sizeof (struct GNUNET_TUN_IPv6Header);
}
udp = (const struct GNUNET_TUN_UdpHeader*) &ip6[1];
msize -= sizeof (struct GNUNET_TUN_IPv6Header);
@@
-1308,7
+1306,7
@@
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
_("Got non-IP packet with %u bytes and protocol %u from TUN\n"),
(unsigned int) msize,
ntohs (tun->proto));
_("Got non-IP packet with %u bytes and protocol %u from TUN\n"),
(unsigned int) msize,
ntohs (tun->proto));
- return;
+ return
GNUNET_OK
;
}
if (msize <= sizeof (struct GNUNET_TUN_UdpHeader) + sizeof (struct GNUNET_TUN_DnsHeader))
{
}
if (msize <= sizeof (struct GNUNET_TUN_UdpHeader) + sizeof (struct GNUNET_TUN_DnsHeader))
{
@@
-1316,7
+1314,7
@@
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
GNUNET_STATISTICS_update (stats,
gettext_noop ("# Non-DNS UDP packet received via TUN interface"),
1, GNUNET_NO);
GNUNET_STATISTICS_update (stats,
gettext_noop ("# Non-DNS UDP packet received via TUN interface"),
1, GNUNET_NO);
- return;
+ return
GNUNET_OK
;
}
msize -= sizeof (struct GNUNET_TUN_UdpHeader);
dns = (const struct GNUNET_TUN_DnsHeader*) &udp[1];
}
msize -= sizeof (struct GNUNET_TUN_UdpHeader);
dns = (const struct GNUNET_TUN_DnsHeader*) &udp[1];
@@
-1383,6
+1381,7
@@
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
1, GNUNET_NO);
/* start request processing state machine */
next_phase (rr);
1, GNUNET_NO);
/* start request processing state machine */
next_phase (rr);
+ return GNUNET_OK;
}
}
@@
-1409,7
+1408,7
@@
receive_dns_request (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
const struct GNUNET_TUN_DnsHeader *dns;
size_t mlen = ntohs (message->size);
size_t dlen = mlen - sizeof (struct GNUNET_MessageHeader);
const struct GNUNET_TUN_DnsHeader *dns;
size_t mlen = ntohs (message->size);
size_t dlen = mlen - sizeof (struct GNUNET_MessageHeader);
- char buf[dlen];
+ char buf[dlen]
GNUNET_ALIGN
;
struct GNUNET_TUN_DnsHeader *dout;
struct sockaddr_in v4;
struct sockaddr_in6 v6;
struct GNUNET_TUN_DnsHeader *dout;
struct sockaddr_in v4;
struct sockaddr_in6 v6;