diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-03-21 02:01:41 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-03-21 02:01:41 +0100 |
commit | e099bddc24fad6c628e29284a585bd50404768b6 (patch) | |
tree | 350e9c44bb5680505d71d961a70f374e03c17023 /src/send.c | |
parent | de428f0b8f3a959038d06d00fcf2fb4d2ce156d2 (diff) | |
download | babel-e099bddc24fad6c628e29284a585bd50404768b6.tar babel-e099bddc24fad6c628e29284a585bd50404768b6.zip |
Add alloca_packet() macro
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -30,8 +30,6 @@ #include "tlv.h" #include "tlv_types.h" -#include <alloca.h> - static void add_ihus(gmrf_t *gmrf, gp_babel_packet_t *packet, size_t max_len, const gp_babel_iface_t *iface) { const gp_babel_neigh_t *neigh; @@ -52,10 +50,7 @@ static void add_ihus(gmrf_t *gmrf, gp_babel_packet_t *packet, size_t max_len, co void gp_babel_send_hellos(gmrf_t *gmrf, gmrf_context_t *ctx) { gmrf_logf(gmrf, LOG_DEBUG, "sending hellos..."); - gp_babel_packet_t *packet = alloca(sizeof(gp_babel_packet_t)+GP_BABEL_PACKET_MAX); - - packet->version = htons(GP_BABEL_VERSION); - packet->len = 0; + gp_babel_packet_t *packet = alloca_packet(GP_BABEL_PACKET_MAX); gp_babel_tlv_hello_t *hello = gp_babel_tlv_add(packet, GP_BABEL_PACKET_MAX, TLV_HELLO, sizeof(gp_babel_tlv_hello_t)); if (!hello) |