[Click] [PATCH] Roofnet (2/3)

Roberto Riggio roberto.riggio at create-net.org
Mon Aug 11 06:09:51 EDT 2008


This patch fixes a warning and a problem with the scheduler that happens 
when the date is moved forward.

Signed-off-by: Roberto Riggio <roberto.riggio at create-net.org>

-- 

diff --git a/roofnet/sr2/sr2ettstat.cc b/roofnet/sr2/sr2ettstat.cc
index 9f182d5..3d9d293 100644
--- a/roofnet/sr2/sr2ettstat.cc
+++ b/roofnet/sr2/sr2ettstat.cc
@@ -21,6 +21,7 @@
 #include <click/glue.hh>
 #include <click/timer.hh>
 #include <click/straccum.hh>
+#include <click/packet_anno.hh>
 #include "sr2ettstat.hh"
 #include "sr2ettmetric.hh"
 #include "sr2txcountmetric.hh"
@@ -212,9 +213,11 @@ SR2ETTStat::run_timer(Timer *)
 	
 	send_probe();
 	
-	_next += Timestamp::make_msec(p);
-	sr2_add_jitter(max_jitter, &_next);
-	_timer.schedule_at(_next);
+	Timestamp delay = Timestamp::make_msec(p);
+	sr2_add_jitter(max_jitter, &delay);
+	_timer.reschedule_after(delay);
+
+	_next = _timer.expiry();
 }
 
 void
@@ -400,7 +403,7 @@ SR2ETTStat::send_probe()
   lp->_cksum = click_in_cksum((unsigned char *) lp, ntohs(lp->_psz));
   
 
-  struct click_wifi_extra *ceh = (struct click_wifi_extra *) p->user_anno();
+  click_wifi_extra *ceh = WIFI_EXTRA_ANNO(p);
   ceh->magic = WIFI_EXTRA_MAGIC;
   ceh->rate = rate;
   checked_output_push(0, p);
@@ -490,7 +493,7 @@ SR2ETTStat::simple_action(Packet *p)
     _arp_table->insert(ip, EtherAddress(eh->ether_shost));
     _rev_arp.insert(EtherAddress(eh->ether_shost), ip);
   }
-  struct click_wifi_extra *ceh = (struct click_wifi_extra *) p->user_anno();
+  click_wifi_extra *ceh = WIFI_EXTRA_ANNO(p);
   uint16_t rate = ceh->rate;
 
   if (ceh->rate != ntohs(lp->_rate)) {


More information about the click mailing list