aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-24 14:47:24 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-24 14:47:24 +0000
commitb9a3fbdc52b32aa6bd27941aba76da528f4e0669 (patch)
treeba48df589a0a669fda1720d8ac036e0245c28490 /src
parentcbcd55809c1896352f506ebc7252b1044aba476d (diff)
downloadgnunet-b9a3fbdc52b32aa6bd27941aba76da528f4e0669.tar.gz
gnunet-b9a3fbdc52b32aa6bd27941aba76da528f4e0669.zip
-trying to resolve alignment issue on sparc
Diffstat (limited to 'src')
-rw-r--r--src/ats/gnunet-service-ats_performance.c2
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c2
-rw-r--r--src/core/gnunet-service-core_clients.c4
-rw-r--r--src/core/gnunet-service-core_kx.c2
-rw-r--r--src/dns/gnunet-service-dns.c8
-rw-r--r--src/exit/gnunet-daemon-exit.c12
-rw-r--r--src/fs/gnunet-service-fs_indexing.c2
-rw-r--r--src/fs/gnunet-service-fs_lc.c2
-rw-r--r--src/fs/gnunet-service-fs_pr.c2
-rw-r--r--src/hello/gnunet-hello.c2
-rw-r--r--src/include/gnunet_common.h5
-rw-r--r--src/mesh/gnunet-service-mesh.c6
-rw-r--r--src/mesh/mesh_api.c2
-rw-r--r--src/nse/gnunet-service-nse.c4
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c6
-rw-r--r--src/transport/gnunet-service-transport.c4
-rw-r--r--src/transport/gnunet-service-transport_clients.c2
-rw-r--r--src/transport/plugin_transport_udp.c2
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c4
-rw-r--r--src/transport/plugin_transport_unix.c2
-rw-r--r--src/util/helper.c2
-rw-r--r--src/util/resolver_api.c2
-rw-r--r--src/vpn/gnunet-service-vpn.c14
23 files changed, 49 insertions, 44 deletions
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c
index b12765620..7ab8e9ae1 100644
--- a/src/ats/gnunet-service-ats_performance.c
+++ b/src/ats/gnunet-service-ats_performance.c
@@ -166,7 +166,7 @@ GAS_performance_notify_clients (const struct GNUNET_PeerIdentity *peer,
166 sizeof (struct PeerInformationMessage) + 166 sizeof (struct PeerInformationMessage) +
167 atsi_count * sizeof (struct GNUNET_ATS_Information) + plugin_addr_len + 167 atsi_count * sizeof (struct GNUNET_ATS_Information) + plugin_addr_len +
168 plugin_name_length; 168 plugin_name_length;
169 char buf[msize]; 169 char buf[msize] GNUNET_ALIGN;
170 struct GNUNET_ATS_Information *atsp; 170 struct GNUNET_ATS_Information *atsp;
171 char *addrp; 171 char *addrp;
172 172
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index 72b72cd3e..ba14637b0 100644
--- a/src/ats/gnunet-service-ats_scheduling.c
+++ b/src/ats/gnunet-service-ats_scheduling.c
@@ -114,7 +114,7 @@ GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity
114 sizeof (struct AddressSuggestionMessage) + 114 sizeof (struct AddressSuggestionMessage) +
115 atsi_count * sizeof (struct GNUNET_ATS_Information) + plugin_addr_len + 115 atsi_count * sizeof (struct GNUNET_ATS_Information) + plugin_addr_len +
116 plugin_name_length; 116 plugin_name_length;
117 char buf[msize]; 117 char buf[msize] GNUNET_ALIGN;
118 struct GNUNET_ATS_Information *atsp; 118 struct GNUNET_ATS_Information *atsp;
119 char *addrp; 119 char *addrp;
120 120
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c
index 621f8604a..c8e1199b7 100644
--- a/src/core/gnunet-service-core_clients.c
+++ b/src/core/gnunet-service-core_clients.c
@@ -694,7 +694,7 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
694{ 694{
695 struct ConnectNotifyMessage *cnm; 695 struct ConnectNotifyMessage *cnm;
696 size_t size; 696 size_t size;
697 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; 697 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
698 struct GNUNET_ATS_Information *a; 698 struct GNUNET_ATS_Information *a;
699 struct DisconnectNotifyMessage dcm; 699 struct DisconnectNotifyMessage dcm;
700 int old_match; 700 int old_match;
@@ -813,7 +813,7 @@ GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender,
813 size_t size = 813 size_t size =
814 msize + sizeof (struct NotifyTrafficMessage) + 814 msize + sizeof (struct NotifyTrafficMessage) +
815 atsi_count * sizeof (struct GNUNET_ATS_Information); 815 atsi_count * sizeof (struct GNUNET_ATS_Information);
816 char buf[size]; 816 char buf[size] GNUNET_ALIGN;
817 struct NotifyTrafficMessage *ntm; 817 struct NotifyTrafficMessage *ntm;
818 struct GNUNET_ATS_Information *a; 818 struct GNUNET_ATS_Information *a;
819 819
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c
index 0cc3521ac..798c114a4 100644
--- a/src/core/gnunet-service-core_kx.c
+++ b/src/core/gnunet-service-core_kx.c
@@ -1458,7 +1458,7 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx,
1458 struct GNUNET_CRYPTO_AuthKey auth_key; 1458 struct GNUNET_CRYPTO_AuthKey auth_key;
1459 struct DeliverMessageContext dmc; 1459 struct DeliverMessageContext dmc;
1460 uint16_t size = ntohs (msg->size); 1460 uint16_t size = ntohs (msg->size);
1461 char buf[size]; 1461 char buf[size] GNUNET_ALIGN;
1462 1462
1463 if (size < 1463 if (size <
1464 sizeof (struct EncryptedMessage) + sizeof (struct GNUNET_MessageHeader)) 1464 sizeof (struct EncryptedMessage) + sizeof (struct GNUNET_MessageHeader))
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c
index 1fc201ff9..b4d64e0d9 100644
--- a/src/dns/gnunet-service-dns.c
+++ b/src/dns/gnunet-service-dns.c
@@ -540,7 +540,7 @@ request_done (struct RequestRecord *rr)
540 return; 540 return;
541 } 541 }
542 { 542 {
543 char buf[reply_len]; 543 char buf[reply_len] GNUNET_ALIGN;
544 size_t off; 544 size_t off;
545 struct GNUNET_TUN_IPv4Header ip4; 545 struct GNUNET_TUN_IPv4Header ip4;
546 struct GNUNET_TUN_IPv6Header ip6; 546 struct GNUNET_TUN_IPv6Header ip6;
@@ -655,7 +655,7 @@ static void
655send_request_to_client (struct RequestRecord *rr, 655send_request_to_client (struct RequestRecord *rr,
656 struct GNUNET_SERVER_Client *client) 656 struct GNUNET_SERVER_Client *client)
657{ 657{
658 char buf[sizeof (struct GNUNET_DNS_Request) + rr->payload_length]; 658 char buf[sizeof (struct GNUNET_DNS_Request) + rr->payload_length] GNUNET_ALIGN;
659 struct GNUNET_DNS_Request *req; 659 struct GNUNET_DNS_Request *req;
660 660
661 if (sizeof (buf) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 661 if (sizeof (buf) >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
@@ -986,7 +986,7 @@ do_dns_read (struct GNUNET_NETWORK_Handle *dnsout)
986#endif 986#endif
987 987
988 { 988 {
989 unsigned char buf[len]; 989 unsigned char buf[len] GNUNET_ALIGN;
990 990
991 addrlen = sizeof (addr); 991 addrlen = sizeof (addr);
992 memset (&addr, 0, sizeof (addr)); 992 memset (&addr, 0, sizeof (addr));
@@ -1409,7 +1409,7 @@ receive_dns_request (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1409 const struct GNUNET_TUN_DnsHeader *dns; 1409 const struct GNUNET_TUN_DnsHeader *dns;
1410 size_t mlen = ntohs (message->size); 1410 size_t mlen = ntohs (message->size);
1411 size_t dlen = mlen - sizeof (struct GNUNET_MessageHeader); 1411 size_t dlen = mlen - sizeof (struct GNUNET_MessageHeader);
1412 char buf[dlen]; 1412 char buf[dlen] GNUNET_ALIGN;
1413 struct GNUNET_TUN_DnsHeader *dout; 1413 struct GNUNET_TUN_DnsHeader *dout;
1414 struct sockaddr_in v4; 1414 struct sockaddr_in v4;
1415 struct sockaddr_in6 v6; 1415 struct sockaddr_in6 v6;
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index 07804c592..861742ee8 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -876,7 +876,7 @@ tcp_from_helper (const struct GNUNET_TUN_TcpHeader *tcp,
876 const void *source_ip) 876 const void *source_ip)
877{ 877{
878 struct TunnelState *state; 878 struct TunnelState *state;
879 char buf[pktlen]; 879 char buf[pktlen] GNUNET_ALIGN;
880 struct GNUNET_TUN_TcpHeader *mtcp; 880 struct GNUNET_TUN_TcpHeader *mtcp;
881 struct GNUNET_EXIT_TcpDataMessage *tdm; 881 struct GNUNET_EXIT_TcpDataMessage *tdm;
882 struct TunnelMessageQueue *tnq; 882 struct TunnelMessageQueue *tnq;
@@ -1493,7 +1493,7 @@ send_tcp_packet_via_tun (const struct SocketAddress *destination_address,
1493 return; 1493 return;
1494 } 1494 }
1495 { 1495 {
1496 char buf[len]; 1496 char buf[len] GNUNET_ALIGN;
1497 struct GNUNET_MessageHeader *hdr; 1497 struct GNUNET_MessageHeader *hdr;
1498 struct GNUNET_TUN_Layer2PacketHeader *tun; 1498 struct GNUNET_TUN_Layer2PacketHeader *tun;
1499 1499
@@ -1852,7 +1852,7 @@ send_icmp_packet_via_tun (const struct SocketAddress *destination_address,
1852 return; 1852 return;
1853 } 1853 }
1854 { 1854 {
1855 char buf[len]; 1855 char buf[len] GNUNET_ALIGN;
1856 struct GNUNET_MessageHeader *hdr; 1856 struct GNUNET_MessageHeader *hdr;
1857 struct GNUNET_TUN_Layer2PacketHeader *tun; 1857 struct GNUNET_TUN_Layer2PacketHeader *tun;
1858 1858
@@ -1985,7 +1985,7 @@ receive_icmp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1985 const struct in_addr *v4; 1985 const struct in_addr *v4;
1986 const struct in6_addr *v6; 1986 const struct in6_addr *v6;
1987 const void *payload; 1987 const void *payload;
1988 char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8]; 1988 char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8] GNUNET_ALIGN;
1989 int af; 1989 int af;
1990 1990
1991 GNUNET_STATISTICS_update (stats, 1991 GNUNET_STATISTICS_update (stats,
@@ -2227,7 +2227,7 @@ receive_icmp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel
2227 const struct GNUNET_EXIT_IcmpServiceMessage *msg; 2227 const struct GNUNET_EXIT_IcmpServiceMessage *msg;
2228 uint16_t pkt_len = ntohs (message->size); 2228 uint16_t pkt_len = ntohs (message->size);
2229 struct GNUNET_TUN_IcmpHeader icmp; 2229 struct GNUNET_TUN_IcmpHeader icmp;
2230 char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8]; 2230 char buf[sizeof (struct GNUNET_TUN_IPv6Header) + 8] GNUNET_ALIGN;
2231 const void *payload; 2231 const void *payload;
2232 2232
2233 GNUNET_STATISTICS_update (stats, 2233 GNUNET_STATISTICS_update (stats,
@@ -2435,7 +2435,7 @@ send_udp_packet_via_tun (const struct SocketAddress *destination_address,
2435 return; 2435 return;
2436 } 2436 }
2437 { 2437 {
2438 char buf[len]; 2438 char buf[len] GNUNET_ALIGN;
2439 struct GNUNET_MessageHeader *hdr; 2439 struct GNUNET_MessageHeader *hdr;
2440 struct GNUNET_TUN_Layer2PacketHeader *tun; 2440 struct GNUNET_TUN_Layer2PacketHeader *tun;
2441 2441
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index b56301962..e45289484 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -368,7 +368,7 @@ GNUNET_FS_handle_index_list_get (void *cls, struct GNUNET_SERVER_Client *client,
368{ 368{
369 struct GNUNET_SERVER_TransmitContext *tc; 369 struct GNUNET_SERVER_TransmitContext *tc;
370 struct IndexInfoMessage *iim; 370 struct IndexInfoMessage *iim;
371 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; 371 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
372 size_t slen; 372 size_t slen;
373 const char *fn; 373 const char *fn;
374 struct IndexInfo *pos; 374 struct IndexInfo *pos;
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index c2fbbecd7..20d430e5a 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -259,7 +259,7 @@ client_response_handler (void *cls, enum GNUNET_BLOCK_EvaluationResult eval,
259 lc = cr->lc; 259 lc = cr->lc;
260 msize = sizeof (struct ClientPutMessage) + data_len; 260 msize = sizeof (struct ClientPutMessage) + data_len;
261 { 261 {
262 char buf[msize]; 262 char buf[msize] GNUNET_ALIGN;
263 263
264 pm = (struct ClientPutMessage *) buf; 264 pm = (struct ClientPutMessage *) buf;
265 pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT); 265 pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index d4b448185..5ae011c46 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1057,7 +1057,7 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr)
1057 const void *xquery; 1057 const void *xquery;
1058 size_t xquery_size; 1058 size_t xquery_size;
1059 struct GNUNET_PeerIdentity pi; 1059 struct GNUNET_PeerIdentity pi;
1060 char buf[sizeof (GNUNET_HashCode) * 2]; 1060 char buf[sizeof (GNUNET_HashCode) * 2] GNUNET_ALIGN;
1061 1061
1062 if (0 != pr->public_data.anonymity_level) 1062 if (0 != pr->public_data.anonymity_level)
1063 return; 1063 return;
diff --git a/src/hello/gnunet-hello.c b/src/hello/gnunet-hello.c
index cbbdce3da..bc35cdd32 100644
--- a/src/hello/gnunet-hello.c
+++ b/src/hello/gnunet-hello.c
@@ -156,7 +156,7 @@ main (int argc, char *argv[])
156 return 1; 156 return 1;
157 } 157 }
158 { 158 {
159 char buf[fsize]; 159 char buf[fsize] GNUNET_ALIGN;
160 160
161 GNUNET_assert (fsize == 161 GNUNET_assert (fsize ==
162 GNUNET_DISK_file_read (fh, buf, fsize)); 162 GNUNET_DISK_file_read (fh, buf, fsize));
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 141df1a5d..e57f8663c 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -150,6 +150,11 @@
150#endif 150#endif
151 151
152/** 152/**
153 * gcc-ism to force alignment
154 */
155#define GNUNET_ALIGN __attribute__((aligned (__BIGGEST_ALIGNMENT__)))
156
157/**
153 * gcc-ism to document unused arguments 158 * gcc-ism to document unused arguments
154 */ 159 */
155#define GNUNET_UNUSED __attribute__((unused)) 160#define GNUNET_UNUSED __attribute__((unused))
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index b6421dd12..86fb48609 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -4370,7 +4370,7 @@ handle_local_unicast (void *cls, struct GNUNET_SERVER_Client *client,
4370 * (pretend we got it from a mesh peer) 4370 * (pretend we got it from a mesh peer)
4371 */ 4371 */
4372 { 4372 {
4373 char buf[ntohs (message->size)]; 4373 char buf[ntohs (message->size)] GNUNET_ALIGN;
4374 struct GNUNET_MESH_Unicast *copy; 4374 struct GNUNET_MESH_Unicast *copy;
4375 4375
4376 /* Work around const limitation */ 4376 /* Work around const limitation */
@@ -4454,7 +4454,7 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client,
4454 * (pretend we got it from a mesh peer) 4454 * (pretend we got it from a mesh peer)
4455 */ 4455 */
4456 { 4456 {
4457 char buf[ntohs (message->size)]; 4457 char buf[ntohs (message->size)] GNUNET_ALIGN;
4458 struct GNUNET_MESH_ToOrigin *copy; 4458 struct GNUNET_MESH_ToOrigin *copy;
4459 4459
4460 /* Work around const limitation */ 4460 /* Work around const limitation */
@@ -4527,7 +4527,7 @@ handle_local_multicast (void *cls, struct GNUNET_SERVER_Client *client,
4527 } 4527 }
4528 4528
4529 { 4529 {
4530 char buf[ntohs (message->size)]; 4530 char buf[ntohs (message->size)] GNUNET_ALIGN;
4531 struct GNUNET_MESH_Multicast *copy; 4531 struct GNUNET_MESH_Multicast *copy;
4532 4532
4533 copy = (struct GNUNET_MESH_Multicast *) buf; 4533 copy = (struct GNUNET_MESH_Multicast *) buf;
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 4b6d6c4f9..a4f497829 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -618,7 +618,7 @@ send_connect (struct GNUNET_MESH_Handle *h)
618 size += h->n_applications * sizeof (GNUNET_MESH_ApplicationType); 618 size += h->n_applications * sizeof (GNUNET_MESH_ApplicationType);
619 size += h->n_handlers * sizeof (uint16_t); 619 size += h->n_handlers * sizeof (uint16_t);
620 { 620 {
621 char buf[size]; 621 char buf[size] GNUNET_ALIGN;
622 struct GNUNET_MESH_ClientConnect *msg; 622 struct GNUNET_MESH_ClientConnect *msg;
623 GNUNET_MESH_ApplicationType *apps; 623 GNUNET_MESH_ApplicationType *apps;
624 uint16_t napps; 624 uint16_t napps;
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index 6a7248cb5..a396cf9cb 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -826,7 +826,7 @@ check_proof_of_work (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pkey,
826 uint64_t val) 826 uint64_t val)
827{ 827{
828 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + 828 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) +
829 sizeof (val)]; 829 sizeof (val)] GNUNET_ALIGN;
830 GNUNET_HashCode result; 830 GNUNET_HashCode result;
831 831
832 memcpy (buf, &val, sizeof (val)); 832 memcpy (buf, &val, sizeof (val));
@@ -871,7 +871,7 @@ find_proof (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
871#define ROUND_SIZE 10 871#define ROUND_SIZE 10
872 uint64_t counter; 872 uint64_t counter;
873 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + 873 char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) +
874 sizeof (uint64_t)]; 874 sizeof (uint64_t)] GNUNET_ALIGN;
875 GNUNET_HashCode result; 875 GNUNET_HashCode result;
876 unsigned int i; 876 unsigned int i;
877 877
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 790c57b37..df3486ea0 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -185,7 +185,7 @@ notify_all (struct HostEntry *entry)
185static struct GNUNET_HELLO_Message * 185static struct GNUNET_HELLO_Message *
186read_host_file (const char *fn) 186read_host_file (const char *fn)
187{ 187{
188 char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; 188 char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
189 const struct GNUNET_HELLO_Message *hello; 189 const struct GNUNET_HELLO_Message *hello;
190 struct GNUNET_HELLO_Message *hello_clean; 190 struct GNUNET_HELLO_Message *hello_clean;
191 int size; 191 int size;
@@ -425,7 +425,7 @@ add_to_tc (void *cls, const GNUNET_HashCode * key, void *value)
425 struct HostEntry *pos = value; 425 struct HostEntry *pos = value;
426 struct InfoMessage *im; 426 struct InfoMessage *im;
427 uint16_t hs; 427 uint16_t hs;
428 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; 428 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
429 429
430 hs = 0; 430 hs = 0;
431 im = (struct InfoMessage *) buf; 431 im = (struct InfoMessage *) buf;
@@ -457,7 +457,7 @@ static int
457discard_hosts_helper (void *cls, const char *fn) 457discard_hosts_helper (void *cls, const char *fn)
458{ 458{
459 struct GNUNET_TIME_Absolute *now = cls; 459 struct GNUNET_TIME_Absolute *now = cls;
460 char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; 460 char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
461 const struct GNUNET_HELLO_Message *hello; 461 const struct GNUNET_HELLO_Message *hello;
462 struct GNUNET_HELLO_Message *new_hello; 462 struct GNUNET_HELLO_Message *new_hello;
463 int size; 463 int size;
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 8d26d6467..671e2eb1a 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -144,7 +144,7 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
144 size_t size = 144 size_t size =
145 sizeof (struct InboundMessage) + msg_size + 145 sizeof (struct InboundMessage) + msg_size +
146 sizeof (struct GNUNET_ATS_Information) * (ats_count + 1); 146 sizeof (struct GNUNET_ATS_Information) * (ats_count + 1);
147 char buf[size]; 147 char buf[size] GNUNET_ALIGN;
148 struct GNUNET_ATS_Information *ap; 148 struct GNUNET_ATS_Information *ap;
149 149
150 ret = GNUNET_TIME_UNIT_ZERO; 150 ret = GNUNET_TIME_UNIT_ZERO;
@@ -463,7 +463,7 @@ neighbours_connect_notification (void *cls,
463 size_t len = 463 size_t len =
464 sizeof (struct ConnectInfoMessage) + 464 sizeof (struct ConnectInfoMessage) +
465 ats_count * sizeof (struct GNUNET_ATS_Information); 465 ats_count * sizeof (struct GNUNET_ATS_Information);
466 char buf[len]; 466 char buf[len] GNUNET_ALIGN;
467 struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf; 467 struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf;
468 struct GNUNET_ATS_Information *ap; 468 struct GNUNET_ATS_Information *ap;
469 469
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c
index 12a4159e1..cadb4d6c6 100644
--- a/src/transport/gnunet-service-transport_clients.c
+++ b/src/transport/gnunet-service-transport_clients.c
@@ -445,7 +445,7 @@ notify_client_about_neighbour (void *cls,
445 size_t size = 445 size_t size =
446 sizeof (struct ConnectInfoMessage) + 446 sizeof (struct ConnectInfoMessage) +
447 ats_count * sizeof (struct GNUNET_ATS_Information); 447 ats_count * sizeof (struct GNUNET_ATS_Information);
448 char buf[size]; 448 char buf[size] GNUNET_ALIGN;
449 449
450 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE); 450 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
451 cim = (struct ConnectInfoMessage *) buf; 451 cim = (struct ConnectInfoMessage *) buf;
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 818c61fb3..8fc2c8f8d 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -1620,7 +1620,7 @@ udp_select_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock)
1620{ 1620{
1621 socklen_t fromlen; 1621 socklen_t fromlen;
1622 char addr[32]; 1622 char addr[32];
1623 char buf[65536]; 1623 char buf[65536] GNUNET_ALIGN;
1624 ssize_t size; 1624 ssize_t size;
1625 const struct GNUNET_MessageHeader *msg; 1625 const struct GNUNET_MessageHeader *msg;
1626 1626
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index 9bb399032..d378f2663 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -253,7 +253,7 @@ udp_ipv4_broadcast_send (void *cls,
253 struct Plugin *plugin = cls; 253 struct Plugin *plugin = cls;
254 int sent; 254 int sent;
255 uint16_t msg_size; 255 uint16_t msg_size;
256 char buf[65536]; 256 char buf[65536] GNUNET_ALIGN;
257 struct BroadcastAddress *baddr; 257 struct BroadcastAddress *baddr;
258 258
259 plugin->send_ipv4_broadcast_task = GNUNET_SCHEDULER_NO_TASK; 259 plugin->send_ipv4_broadcast_task = GNUNET_SCHEDULER_NO_TASK;
@@ -294,7 +294,7 @@ udp_ipv6_broadcast_send (void *cls,
294 struct Plugin *plugin = cls; 294 struct Plugin *plugin = cls;
295 int sent; 295 int sent;
296 uint16_t msg_size; 296 uint16_t msg_size;
297 char buf[65536]; 297 char buf[65536] GNUNET_ALIGN;
298 298
299 plugin->send_ipv6_broadcast_task = GNUNET_SCHEDULER_NO_TASK; 299 plugin->send_ipv6_broadcast_task = GNUNET_SCHEDULER_NO_TASK;
300 300
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index bd8a2db5b..04c8a45be 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -690,7 +690,7 @@ unix_demultiplexer (struct Plugin *plugin, struct GNUNET_PeerIdentity *sender,
690static void 690static void
691unix_plugin_select_read (struct Plugin * plugin) 691unix_plugin_select_read (struct Plugin * plugin)
692{ 692{
693 char buf[65536]; 693 char buf[65536] GNUNET_ALIGN;
694 struct UNIXMessage *msg; 694 struct UNIXMessage *msg;
695 struct GNUNET_PeerIdentity sender; 695 struct GNUNET_PeerIdentity sender;
696 struct sockaddr_un un; 696 struct sockaddr_un un;
diff --git a/src/util/helper.c b/src/util/helper.c
index 43ec23a88..1eaadfa78 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -220,7 +220,7 @@ helper_read (void *cls,
220 const struct GNUNET_SCHEDULER_TaskContext *tc) 220 const struct GNUNET_SCHEDULER_TaskContext *tc)
221{ 221{
222 struct GNUNET_HELPER_Handle *h = cls; 222 struct GNUNET_HELPER_Handle *h = cls;
223 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; 223 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE] GNUNET_ALIGN;
224 ssize_t t; 224 ssize_t t;
225 225
226 h->read_task = GNUNET_SCHEDULER_NO_TASK; 226 h->read_task = GNUNET_SCHEDULER_NO_TASK;
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c
index 0c12afad4..ab0574efa 100644
--- a/src/util/resolver_api.c
+++ b/src/util/resolver_api.c
@@ -606,7 +606,7 @@ static void
606process_requests () 606process_requests ()
607{ 607{
608 struct GNUNET_RESOLVER_GetMessage *msg; 608 struct GNUNET_RESOLVER_GetMessage *msg;
609 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; 609 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
610 struct GNUNET_RESOLVER_RequestHandle *rh; 610 struct GNUNET_RESOLVER_RequestHandle *rh;
611 611
612 if (NULL == client) 612 if (NULL == client)
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index bd0aa4a74..5cd636900 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -460,7 +460,7 @@ send_client_reply (struct GNUNET_SERVER_Client *client,
460 int result_af, 460 int result_af,
461 const void *addr) 461 const void *addr)
462{ 462{
463 char buf[sizeof (struct RedirectToIpResponseMessage) + sizeof (struct in6_addr)]; 463 char buf[sizeof (struct RedirectToIpResponseMessage) + sizeof (struct in6_addr)] GNUNET_ALIGN;
464 struct RedirectToIpResponseMessage *res; 464 struct RedirectToIpResponseMessage *res;
465 size_t rlen; 465 size_t rlen;
466 466
@@ -1742,7 +1742,7 @@ receive_icmp_back (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1742 { 1742 {
1743 /* reserve some extra space in case we have an ICMP type here where 1743 /* reserve some extra space in case we have an ICMP type here where
1744 we will need to make up the payload ourselves */ 1744 we will need to make up the payload ourselves */
1745 char buf[size + sizeof (struct GNUNET_TUN_IPv4Header) + 8]; 1745 char buf[size + sizeof (struct GNUNET_TUN_IPv4Header) + 8] GNUNET_ALIGN;
1746 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; 1746 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf;
1747 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 1747 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1];
1748 struct GNUNET_TUN_IPv4Header *ipv4 = (struct GNUNET_TUN_IPv4Header *) &tun[1]; 1748 struct GNUNET_TUN_IPv4Header *ipv4 = (struct GNUNET_TUN_IPv4Header *) &tun[1];
@@ -1879,7 +1879,7 @@ receive_icmp_back (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1879 sizeof (struct GNUNET_TUN_Layer2PacketHeader) + 1879 sizeof (struct GNUNET_TUN_Layer2PacketHeader) +
1880 mlen; 1880 mlen;
1881 { 1881 {
1882 char buf[size + sizeof (struct GNUNET_TUN_IPv6Header) + 8]; 1882 char buf[size + sizeof (struct GNUNET_TUN_IPv6Header) + 8] GNUNET_ALIGN;
1883 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; 1883 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf;
1884 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 1884 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1];
1885 struct GNUNET_TUN_IPv6Header *ipv6 = (struct GNUNET_TUN_IPv6Header *) &tun[1]; 1885 struct GNUNET_TUN_IPv6Header *ipv6 = (struct GNUNET_TUN_IPv6Header *) &tun[1];
@@ -2083,7 +2083,7 @@ receive_udp_back (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
2083 sizeof (struct GNUNET_TUN_Layer2PacketHeader) + 2083 sizeof (struct GNUNET_TUN_Layer2PacketHeader) +
2084 mlen; 2084 mlen;
2085 { 2085 {
2086 char buf[size]; 2086 char buf[size] GNUNET_ALIGN;
2087 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; 2087 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf;
2088 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 2088 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1];
2089 struct GNUNET_TUN_IPv4Header *ipv4 = (struct GNUNET_TUN_IPv4Header *) &tun[1]; 2089 struct GNUNET_TUN_IPv4Header *ipv4 = (struct GNUNET_TUN_IPv4Header *) &tun[1];
@@ -2128,7 +2128,7 @@ receive_udp_back (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
2128 sizeof (struct GNUNET_TUN_Layer2PacketHeader) + 2128 sizeof (struct GNUNET_TUN_Layer2PacketHeader) +
2129 mlen; 2129 mlen;
2130 { 2130 {
2131 char buf[size]; 2131 char buf[size] GNUNET_ALIGN;
2132 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; 2132 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf;
2133 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 2133 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1];
2134 struct GNUNET_TUN_IPv6Header *ipv6 = (struct GNUNET_TUN_IPv6Header *) &tun[1]; 2134 struct GNUNET_TUN_IPv6Header *ipv6 = (struct GNUNET_TUN_IPv6Header *) &tun[1];
@@ -2241,7 +2241,7 @@ receive_tcp_back (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
2241 sizeof (struct GNUNET_TUN_Layer2PacketHeader) + 2241 sizeof (struct GNUNET_TUN_Layer2PacketHeader) +
2242 mlen; 2242 mlen;
2243 { 2243 {
2244 char buf[size]; 2244 char buf[size] GNUNET_ALIGN;
2245 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; 2245 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf;
2246 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 2246 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1];
2247 struct GNUNET_TUN_IPv4Header *ipv4 = (struct GNUNET_TUN_IPv4Header *) &tun[1]; 2247 struct GNUNET_TUN_IPv4Header *ipv4 = (struct GNUNET_TUN_IPv4Header *) &tun[1];
@@ -2280,7 +2280,7 @@ receive_tcp_back (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
2280 sizeof (struct GNUNET_TUN_Layer2PacketHeader) + 2280 sizeof (struct GNUNET_TUN_Layer2PacketHeader) +
2281 mlen; 2281 mlen;
2282 { 2282 {
2283 char buf[size]; 2283 char buf[size] GNUNET_ALIGN;
2284 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; 2284 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf;
2285 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 2285 struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1];
2286 struct GNUNET_TUN_IPv6Header *ipv6 = (struct GNUNET_TUN_IPv6Header *) &tun[1]; 2286 struct GNUNET_TUN_IPv6Header *ipv6 = (struct GNUNET_TUN_IPv6Header *) &tun[1];