From 3adf8e58075f005e81ee168d18d25c1b0a41bff5 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 1 Mar 2009 10:29:50 +0000 Subject: [PATCH] Call output packet sniffers after the MAC has sent the packet --- core/net/rime/rime.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/net/rime/rime.c b/core/net/rime/rime.c index 4b83b03b4..40ede22fd 100644 --- a/core/net/rime/rime.c +++ b/core/net/rime/rime.c @@ -33,7 +33,7 @@ * * This file is part of the Contiki operating system. * - * $Id: rime.c,v 1.18 2009/02/09 22:05:33 adamdunkels Exp $ + * $Id: rime.c,v 1.19 2009/03/01 10:29:50 adamdunkels Exp $ */ /** @@ -128,13 +128,14 @@ rime_output(void) RIMESTATS_ADD(tx); rimebuf_compact(); - for(s = list_head(sniffers); s != NULL; s = s->next) { - if(s->output_callback != NULL) { - s->output_callback(); - } - } if(rime_mac) { - rime_mac->send(); + if(rime_mac->send()) { + /* Call sniffers, but only if the packet was sent. */ + for(s = list_head(sniffers); s != NULL; s = s->next) { + if(s->output_callback != NULL) { + s->output_callback(); + } + } } } /*---------------------------------------------------------------------------*/