From e2b4956a7fb89ea006c61911ee6f4c40d457a344 Mon Sep 17 00:00:00 2001 From: nifi Date: Thu, 14 Oct 2010 19:08:39 +0000 Subject: [PATCH] Bug fix: release the packet and notify the sender if RDC returned an error --- core/net/mac/csma.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/net/mac/csma.c b/core/net/mac/csma.c index 3f8a7ca2a..999e66657 100644 --- a/core/net/mac/csma.c +++ b/core/net/mac/csma.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: csma.c,v 1.20 2010/10/03 20:37:32 adamdunkels Exp $ + * $Id: csma.c,v 1.21 2010/10/14 19:08:39 nifi Exp $ */ /** @@ -176,8 +176,12 @@ packet_sent(void *ptr, int status, int num_transmissions) free_packet(q); mac_call_sent_callback(sent, cptr, status, num_tx); } - } else if(status == MAC_TX_OK) { - PRINTF("csma: rexmit ok %d\n", q->transmissions); + } else { + if(status == MAC_TX_OK) { + PRINTF("csma: rexmit ok %d\n", q->transmissions); + } else { + PRINTF("csma: rexmit failed %d: %d\n", q->transmissions, status); + } free_packet(q); mac_call_sent_callback(sent, cptr, status, num_tx); }