From b9a3fbdc52b32aa6bd27941aba76da528f4e0669 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 24 Apr 2012 14:47:24 +0000 Subject: [PATCH] -trying to resolve alignment issue on sparc --- src/ats/gnunet-service-ats_performance.c | 2 +- src/ats/gnunet-service-ats_scheduling.c | 2 +- src/core/gnunet-service-core_clients.c | 4 ++-- src/core/gnunet-service-core_kx.c | 2 +- src/dns/gnunet-service-dns.c | 8 ++++---- src/exit/gnunet-daemon-exit.c | 12 ++++++------ src/fs/gnunet-service-fs_indexing.c | 2 +- src/fs/gnunet-service-fs_lc.c | 2 +- src/fs/gnunet-service-fs_pr.c | 2 +- src/hello/gnunet-hello.c | 2 +- src/include/gnunet_common.h | 5 +++++ src/mesh/gnunet-service-mesh.c | 6 +++--- src/mesh/mesh_api.c | 2 +- src/nse/gnunet-service-nse.c | 4 ++-- src/peerinfo/gnunet-service-peerinfo.c | 6 +++--- src/transport/gnunet-service-transport.c | 4 ++-- src/transport/gnunet-service-transport_clients.c | 2 +- src/transport/plugin_transport_udp.c | 2 +- src/transport/plugin_transport_udp_broadcasting.c | 4 ++-- src/transport/plugin_transport_unix.c | 2 +- src/util/helper.c | 2 +- src/util/resolver_api.c | 2 +- src/vpn/gnunet-service-vpn.c | 14 +++++++------- 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, sizeof (struct PeerInformationMessage) + atsi_count * sizeof (struct GNUNET_ATS_Information) + plugin_addr_len + plugin_name_length; - char buf[msize]; + char buf[msize] GNUNET_ALIGN; struct GNUNET_ATS_Information *atsp; char *addrp; 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 sizeof (struct AddressSuggestionMessage) + atsi_count * sizeof (struct GNUNET_ATS_Information) + plugin_addr_len + plugin_name_length; - char buf[msize]; + char buf[msize] GNUNET_ALIGN; struct GNUNET_ATS_Information *atsp; char *addrp; 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, { struct ConnectNotifyMessage *cnm; size_t size; - char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; + char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; struct GNUNET_ATS_Information *a; struct DisconnectNotifyMessage dcm; int old_match; @@ -813,7 +813,7 @@ GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender, size_t size = msize + sizeof (struct NotifyTrafficMessage) + atsi_count * sizeof (struct GNUNET_ATS_Information); - char buf[size]; + char buf[size] GNUNET_ALIGN; struct NotifyTrafficMessage *ntm; struct GNUNET_ATS_Information *a; 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, struct GNUNET_CRYPTO_AuthKey auth_key; struct DeliverMessageContext dmc; uint16_t size = ntohs (msg->size); - char buf[size]; + char buf[size] GNUNET_ALIGN; if (size < 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) return; } { - char buf[reply_len]; + char buf[reply_len] GNUNET_ALIGN; size_t off; struct GNUNET_TUN_IPv4Header ip4; struct GNUNET_TUN_IPv6Header ip6; @@ -655,7 +655,7 @@ static void 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) @@ -986,7 +986,7 @@ do_dns_read (struct GNUNET_NETWORK_Handle *dnsout) #endif { - unsigned char buf[len]; + unsigned char buf[len] GNUNET_ALIGN; addrlen = sizeof (addr); memset (&addr, 0, sizeof (addr)); @@ -1409,7 +1409,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); - char buf[dlen]; + char buf[dlen] GNUNET_ALIGN; struct GNUNET_TUN_DnsHeader *dout; struct sockaddr_in v4; 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, 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; @@ -1493,7 +1493,7 @@ send_tcp_packet_via_tun (const struct SocketAddress *destination_address, return; } { - char buf[len]; + char buf[len] GNUNET_ALIGN; struct GNUNET_MessageHeader *hdr; struct GNUNET_TUN_Layer2PacketHeader *tun; @@ -1852,7 +1852,7 @@ send_icmp_packet_via_tun (const struct SocketAddress *destination_address, return; } { - char buf[len]; + char buf[len] GNUNET_ALIGN; struct GNUNET_MessageHeader *hdr; struct GNUNET_TUN_Layer2PacketHeader *tun; @@ -1985,7 +1985,7 @@ receive_icmp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, 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, @@ -2227,7 +2227,7 @@ receive_icmp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel 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, @@ -2435,7 +2435,7 @@ send_udp_packet_via_tun (const struct SocketAddress *destination_address, return; } { - char buf[len]; + char buf[len] GNUNET_ALIGN; struct GNUNET_MessageHeader *hdr; struct GNUNET_TUN_Layer2PacketHeader *tun; 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, { struct GNUNET_SERVER_TransmitContext *tc; struct IndexInfoMessage *iim; - char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; + char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; size_t slen; const char *fn; 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, lc = cr->lc; msize = sizeof (struct ClientPutMessage) + data_len; { - char buf[msize]; + char buf[msize] GNUNET_ALIGN; pm = (struct ClientPutMessage *) buf; 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) const void *xquery; size_t xquery_size; struct GNUNET_PeerIdentity pi; - char buf[sizeof (GNUNET_HashCode) * 2]; + char buf[sizeof (GNUNET_HashCode) * 2] GNUNET_ALIGN; if (0 != pr->public_data.anonymity_level) 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[]) return 1; } { - char buf[fsize]; + char buf[fsize] GNUNET_ALIGN; GNUNET_assert (fsize == 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 @@ -149,6 +149,11 @@ #define GNUNET_GCC_STRUCT_LAYOUT #endif +/** + * gcc-ism to force alignment + */ +#define GNUNET_ALIGN __attribute__((aligned (__BIGGEST_ALIGNMENT__))) + /** * gcc-ism to document unused arguments */ 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, * (pretend we got it from a mesh peer) */ { - char buf[ntohs (message->size)]; + char buf[ntohs (message->size)] GNUNET_ALIGN; struct GNUNET_MESH_Unicast *copy; /* Work around const limitation */ @@ -4454,7 +4454,7 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client, * (pretend we got it from a mesh peer) */ { - char buf[ntohs (message->size)]; + char buf[ntohs (message->size)] GNUNET_ALIGN; struct GNUNET_MESH_ToOrigin *copy; /* Work around const limitation */ @@ -4527,7 +4527,7 @@ handle_local_multicast (void *cls, struct GNUNET_SERVER_Client *client, } { - char buf[ntohs (message->size)]; + char buf[ntohs (message->size)] GNUNET_ALIGN; struct GNUNET_MESH_Multicast *copy; 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) size += h->n_applications * sizeof (GNUNET_MESH_ApplicationType); size += h->n_handlers * sizeof (uint16_t); { - char buf[size]; + char buf[size] GNUNET_ALIGN; struct GNUNET_MESH_ClientConnect *msg; GNUNET_MESH_ApplicationType *apps; 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, uint64_t val) { char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + - sizeof (val)]; + sizeof (val)] GNUNET_ALIGN; GNUNET_HashCode result; memcpy (buf, &val, sizeof (val)); @@ -871,7 +871,7 @@ find_proof (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) #define ROUND_SIZE 10 uint64_t counter; char buf[sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + - sizeof (uint64_t)]; + sizeof (uint64_t)] GNUNET_ALIGN; GNUNET_HashCode result; unsigned int i; 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) static struct GNUNET_HELLO_Message * read_host_file (const char *fn) { - char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; + char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; const struct GNUNET_HELLO_Message *hello; struct GNUNET_HELLO_Message *hello_clean; int size; @@ -425,7 +425,7 @@ add_to_tc (void *cls, const GNUNET_HashCode * key, void *value) struct HostEntry *pos = value; struct InfoMessage *im; uint16_t hs; - char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; + char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; hs = 0; im = (struct InfoMessage *) buf; @@ -457,7 +457,7 @@ static int discard_hosts_helper (void *cls, const char *fn) { struct GNUNET_TIME_Absolute *now = cls; - char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; + char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; const struct GNUNET_HELLO_Message *hello; struct GNUNET_HELLO_Message *new_hello; 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, size_t size = sizeof (struct InboundMessage) + msg_size + sizeof (struct GNUNET_ATS_Information) * (ats_count + 1); - char buf[size]; + char buf[size] GNUNET_ALIGN; struct GNUNET_ATS_Information *ap; ret = GNUNET_TIME_UNIT_ZERO; @@ -463,7 +463,7 @@ neighbours_connect_notification (void *cls, size_t len = sizeof (struct ConnectInfoMessage) + ats_count * sizeof (struct GNUNET_ATS_Information); - char buf[len]; + char buf[len] GNUNET_ALIGN; struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf; struct GNUNET_ATS_Information *ap; 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, size_t size = sizeof (struct ConnectInfoMessage) + ats_count * sizeof (struct GNUNET_ATS_Information); - char buf[size]; + char buf[size] GNUNET_ALIGN; GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE); 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) { socklen_t fromlen; char addr[32]; - char buf[65536]; + char buf[65536] GNUNET_ALIGN; ssize_t size; const struct GNUNET_MessageHeader *msg; 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, struct Plugin *plugin = cls; int sent; uint16_t msg_size; - char buf[65536]; + char buf[65536] GNUNET_ALIGN; struct BroadcastAddress *baddr; plugin->send_ipv4_broadcast_task = GNUNET_SCHEDULER_NO_TASK; @@ -294,7 +294,7 @@ udp_ipv6_broadcast_send (void *cls, struct Plugin *plugin = cls; int sent; uint16_t msg_size; - char buf[65536]; + char buf[65536] GNUNET_ALIGN; plugin->send_ipv6_broadcast_task = GNUNET_SCHEDULER_NO_TASK; 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, static void unix_plugin_select_read (struct Plugin * plugin) { - char buf[65536]; + char buf[65536] GNUNET_ALIGN; struct UNIXMessage *msg; struct GNUNET_PeerIdentity sender; 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, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_HELPER_Handle *h = cls; - char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; + char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE] GNUNET_ALIGN; ssize_t t; 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 process_requests () { struct GNUNET_RESOLVER_GetMessage *msg; - char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; + char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; struct GNUNET_RESOLVER_RequestHandle *rh; 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, int result_af, const void *addr) { - char buf[sizeof (struct RedirectToIpResponseMessage) + sizeof (struct in6_addr)]; + char buf[sizeof (struct RedirectToIpResponseMessage) + sizeof (struct in6_addr)] GNUNET_ALIGN; struct RedirectToIpResponseMessage *res; size_t rlen; @@ -1742,7 +1742,7 @@ receive_icmp_back (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, { /* reserve some extra space in case we have an ICMP type here where we will need to make up the payload ourselves */ - char buf[size + sizeof (struct GNUNET_TUN_IPv4Header) + 8]; + char buf[size + sizeof (struct GNUNET_TUN_IPv4Header) + 8] GNUNET_ALIGN; struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 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, sizeof (struct GNUNET_TUN_Layer2PacketHeader) + mlen; { - char buf[size + sizeof (struct GNUNET_TUN_IPv6Header) + 8]; + char buf[size + sizeof (struct GNUNET_TUN_IPv6Header) + 8] GNUNET_ALIGN; struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 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, sizeof (struct GNUNET_TUN_Layer2PacketHeader) + mlen; { - char buf[size]; + char buf[size] GNUNET_ALIGN; struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 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, sizeof (struct GNUNET_TUN_Layer2PacketHeader) + mlen; { - char buf[size]; + char buf[size] GNUNET_ALIGN; struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 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, sizeof (struct GNUNET_TUN_Layer2PacketHeader) + mlen; { - char buf[size]; + char buf[size] GNUNET_ALIGN; struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; 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, sizeof (struct GNUNET_TUN_Layer2PacketHeader) + mlen; { - char buf[size]; + char buf[size] GNUNET_ALIGN; struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) buf; struct GNUNET_TUN_Layer2PacketHeader *tun = (struct GNUNET_TUN_Layer2PacketHeader*) &msg[1]; struct GNUNET_TUN_IPv6Header *ipv6 = (struct GNUNET_TUN_IPv6Header *) &tun[1]; -- 2.25.1