From 7efd6c82cb359b5220134f5e65828a671f4e8b1c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 4 Aug 2013 13:58:09 +0200 Subject: There is no reason to keep a hello seqno for each interface separately --- src/babel.h | 3 +-- src/send.c | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/babel.h b/src/babel.h index c55a3a8..334ee57 100644 --- a/src/babel.h +++ b/src/babel.h @@ -56,6 +56,7 @@ struct gmrf_context { gmrf_t *gmrf; gp_babel_node_id_t self; + uint16_t hello_seqno; gmrf_iface_state_t *interfaces; gp_babel_neigh_t *neighbours; @@ -68,8 +69,6 @@ struct gmrf_iface_state { gmrf_iface_t *gmrf_iface; - uint16_t seqno; - gp_babel_neigh_t *neighbours; }; diff --git a/src/send.c b/src/send.c index e1c582f..f649a34 100644 --- a/src/send.c +++ b/src/send.c @@ -104,13 +104,15 @@ void gp_babel_send_hellos(gmrf_context_t *ctx) { gmrf_iface_state_t *iface; for (iface = ctx->interfaces; iface; iface = iface->next) { - hello->seqno = htons(iface->seqno++); + hello->seqno = htons(ctx->hello_seqno); buf->packet.len = len; add_ihus(ctx, buf, iface); send_iface(ctx, iface, &buf->packet); } + + ctx->hello_seqno++; } /*static inline bool add_node_id_tlv(gp_babel_packet_buf_t *buf, const gp_babel_node_id_t *node_id) { -- cgit v1.2.3