From 522f991f1454f59cfcdcdc624a66e3e751c7d1d7 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Thu, 20 Aug 2009 18:59:17 +0000 Subject: [PATCH] Set sender and receiver packet attributes on incoming packets: patch by Gidon Ernst --- core/net/mac/xmac.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/net/mac/xmac.c b/core/net/mac/xmac.c index 856bc5301..fcc5d5e46 100644 --- a/core/net/mac/xmac.c +++ b/core/net/mac/xmac.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: xmac.c,v 1.34 2009/06/22 11:14:11 nifi Exp $ + * $Id: xmac.c,v 1.35 2009/08/20 18:59:17 adamdunkels Exp $ */ /** @@ -57,7 +57,7 @@ #define WITH_CHANNEL_CHECK 0 /* Seems to work badly when enabled */ #define WITH_TIMESYNCH 0 #define WITH_QUEUE 0 -#define WITH_ACK_OPTIMIZATION 1 +#define WITH_ACK_OPTIMIZATION 0 #define WITH_RANDOM_WAIT_BEFORE_SEND 0 struct announcement_data { @@ -614,6 +614,12 @@ read_packet(void) asleep. */ off(); + /* Set sender and receiver packet attributes */ + if(!rimeaddr_cmp(&hdr->receiver, &rimeaddr_null)) { + packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, &hdr->receiver); + } + packetbuf_set_addr(PACKETBUF_ADDR_SENDER, &hdr->sender); + #if XMAC_CONF_COMPOWER /* Accumulate the power consumption for the packet reception. */ compower_accumulate(¤t_packet);