From 8e4541864997c34b46d8f4dbb3ee89a07dd47c0c Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sat, 31 Mar 2007 18:47:27 +0000 Subject: [PATCH] Made sure that two packets sent consecutively from the same node do not interfere with each other --- platform/netsim/ether.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/platform/netsim/ether.c b/platform/netsim/ether.c index 1f73892eb..d07c95c91 100644 --- a/platform/netsim/ether.c +++ b/platform/netsim/ether.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: ether.c,v 1.7 2007/03/29 22:25:25 adamdunkels Exp $ + * $Id: ether.c,v 1.8 2007/03/31 18:47:27 adamdunkels Exp $ */ /** * \file @@ -434,7 +434,15 @@ ether_tick(void) ((q->x - x) * (q->x - x) + (q->y - y) * (q->y - y) <= ether_strength() * ether_strength())) { - interference = 1; + + /* If the potentially interfering packets were sent from + the same node, then they don't interfere with each + other. Otherwise they interfere and we sent the + interference flag to 1. */ + if(p->x != q->x || + p->y != q->y) { + interference = 1; + } break; } }