There is no reason to keep a hello seqno for each interface separately
This commit is contained in:
parent
ef586cf976
commit
7efd6c82cb
2 changed files with 4 additions and 3 deletions
|
@ -56,6 +56,7 @@ struct gmrf_context {
|
||||||
gmrf_t *gmrf;
|
gmrf_t *gmrf;
|
||||||
|
|
||||||
gp_babel_node_id_t self;
|
gp_babel_node_id_t self;
|
||||||
|
uint16_t hello_seqno;
|
||||||
|
|
||||||
gmrf_iface_state_t *interfaces;
|
gmrf_iface_state_t *interfaces;
|
||||||
gp_babel_neigh_t *neighbours;
|
gp_babel_neigh_t *neighbours;
|
||||||
|
@ -68,8 +69,6 @@ struct gmrf_iface_state {
|
||||||
|
|
||||||
gmrf_iface_t *gmrf_iface;
|
gmrf_iface_t *gmrf_iface;
|
||||||
|
|
||||||
uint16_t seqno;
|
|
||||||
|
|
||||||
gp_babel_neigh_t *neighbours;
|
gp_babel_neigh_t *neighbours;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -104,13 +104,15 @@ void gp_babel_send_hellos(gmrf_context_t *ctx) {
|
||||||
|
|
||||||
gmrf_iface_state_t *iface;
|
gmrf_iface_state_t *iface;
|
||||||
for (iface = ctx->interfaces; iface; iface = iface->next) {
|
for (iface = ctx->interfaces; iface; iface = iface->next) {
|
||||||
hello->seqno = htons(iface->seqno++);
|
hello->seqno = htons(ctx->hello_seqno);
|
||||||
|
|
||||||
buf->packet.len = len;
|
buf->packet.len = len;
|
||||||
add_ihus(ctx, buf, iface);
|
add_ihus(ctx, buf, iface);
|
||||||
|
|
||||||
send_iface(ctx, iface, &buf->packet);
|
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) {
|
/*static inline bool add_node_id_tlv(gp_babel_packet_buf_t *buf, const gp_babel_node_id_t *node_id) {
|
||||||
|
|
Reference in a new issue