From 79c6fd3f14b51d37c45b78d2a4f511927b9eac94 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 26 Mar 2013 04:00:47 +0100 Subject: Fix handling of announces without payload --- src/babel.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/babel.h') diff --git a/src/babel.h b/src/babel.h index 52abfd5..cf8b435 100644 --- a/src/babel.h +++ b/src/babel.h @@ -47,6 +47,9 @@ #define GP_BABEL_MAINTENANCE_INTERVAL GP_BABEL_HELLO_INTERVAL +#define GP_BABEL_UPDATE_FLAG_HAS_PAYLOAD 0x01 + + struct gmrf_context { gp_babel_node_id_t self; @@ -99,9 +102,9 @@ struct gp_babel_announce { gp_babel_nexthop_t *selected; gp_babel_nexthop_t *nexthops; - /* an incomplete announcement is specified by a len value of 0xff with NULL data */ + /* an incomplete announcement is specified by a len value of 0xff with NULL payload */ uint8_t len; - uint8_t *data; + uint8_t *payload; }; struct gp_babel_nexthop { @@ -165,7 +168,7 @@ void gp_babel_handle_packet(gmrf_t *gmrf, gmrf_context_t *ctx, gp_babel_iface_t void gp_babel_send_ack(gmrf_t *gmrf, gmrf_context_t *ctx, gp_babel_neigh_t *neigh, uint16_t nonce); void gp_babel_send_hellos(gmrf_t *gmrf, gmrf_context_t *ctx); -void gp_babel_send_update(gmrf_t *gmrf, gmrf_context_t *ctx, gp_babel_iface_t *iface, gp_babel_neigh_t *neigh, gp_babel_announce_t *announce, bool with_data); +void gp_babel_send_update(gmrf_t *gmrf, gmrf_context_t *ctx, gp_babel_iface_t *iface, gp_babel_neigh_t *neigh, gp_babel_announce_t *announce, bool with_payload); gp_babel_announce_t* gp_babel_announce_new(gmrf_t *gmrf, gmrf_context_t *ctx); -- cgit v1.2.3