From 0cabe483c3723d475bc1e3d1a96d8509b0f52f8b Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Thu, 7 Oct 2010 15:52:28 +0000 Subject: [PATCH] Don't call sink recv function for zero-size packets, since these most likely are link estimate probes or keepalive packets. Explicitly set eseqno to zero when opening a new connection. --- core/net/rime/collect.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/net/rime/collect.c b/core/net/rime/collect.c index 66eca2c8f..7c8c54d89 100644 --- a/core/net/rime/collect.c +++ b/core/net/rime/collect.c @@ -33,7 +33,7 @@ * * This file is part of the Contiki operating system. * - * $Id: collect.c,v 1.58 2010/10/05 20:06:47 adamdunkels Exp $ + * $Id: collect.c,v 1.59 2010/10/07 15:52:28 adamdunkels Exp $ */ /** @@ -919,7 +919,7 @@ node_packet_received(struct unicast_conn *c, const rimeaddr_t *from) packetbuf_hdrreduce(sizeof(struct data_msg_hdr)); /* Call receive function. */ - if(tc->cb->recv != NULL) { + if(packetbuf_datalen() > 0 && tc->cb->recv != NULL) { tc->cb->recv(packetbuf_addr(PACKETBUF_ADDR_ESENDER), packetbuf_attr(PACKETBUF_ATTR_EPACKET_ID), packetbuf_attr(PACKETBUF_ATTR_HOPS)); @@ -1177,6 +1177,7 @@ collect_open(struct collect_conn *tc, uint16_t channels, tc->cb = cb; tc->is_router = is_router; tc->seqno = 10; + tc->eseqno = 0; LIST_STRUCT_INIT(tc, send_queue_list); collect_neighbor_list_new(&tc->neighbor_list); tc->send_queue.list = &(tc->send_queue_list);