Best regards,
Sergey Konyahin
Index: pyntk/ntk/core/hook.py
===================================================================
--- pyntk/ntk/core/hook.py      (revision 1362)
+++ pyntk/ntk/core/hook.py      (working copy)
@@ -118,8 +118,11 @@
         hfn2=[]
         hfn_lvlmax = -1
         for h in hfn:
-                if h[1][0] >= hfn_lvlmax:
+                if h[1][0] > hfn_lvlmax:
                         hfn_lvlmax = h[1][0]
+                        hfn2 = []
+                     
+                if h[1][0] == hfn_lvlmax:
                         hfn2.append(h)
                 hfn=hfn2
         ##
Index: pyntk/ntk/core/radar.py
===================================================================
--- pyntk/ntk/core/radar.py     (revision 1362)
+++ pyntk/ntk/core/radar.py     (working copy)
@@ -259,9 +259,10 @@
 
 
 class Radar(object):
-    __slots__ = ['inet', 'bouquet_numb', 'bcast_send_time',
-        'bcast_arrival_time', 'bquet_dimension', 'max_wait_time', 'broadcast',
-        'neigh', 'events', 'netid', 'do_reply', 'remotable_funcs', 'ntkd_id' ]
+    __slots__ = ['inet', 'bouquet_numb', 'bcast_send_time', 'xtime',
+        'bcast_arrival_time', 'bquet_num', 'max_wait_time', 'broadcast',
+        'neigh', 'events', 'netid', 'do_reply', 'remotable_funcs', 'ntkd_id',
+        'radar_id' ]
 
     def __init__(self, inet, broadcast, xtime,
                  bquet_num=16, max_neigh=16, max_wait_time=8):
@@ -350,11 +351,11 @@
         net_device = _rpc_caller.dev
 
         # this is the rtt
-        time_elapsed = int((self.xtime.time() - bcast_send_time) / 2)
+        time_elapsed = int((self.xtime.time() - self.bcast_send_time) / 2)
         # let's store it in the bcast_arrival_time table
         if(ip in self.bcast_arrival_time):
             if(net_device in self.bcast_arrival_time[ip]):
-                self.bcast_arrival_time[ip].append(time_elapsed)
+                self.bcast_arrival_time[ip][net_device].append(time_elapsed)
             else:
                 self.bcast_arrival_time[ip][net_device] = [time_elapsed]
         else:
@@ -391,6 +392,6 @@
         all_avg = {}
         # for each ip
         for ip in self.bcast_arrival_time:
-            devs = get_avg_rtt(ip)
-            all_avg[ip] = NodeInfo(dict(devs), devs[0], Ntk(ip))
+            devs = self.get_avg_rtt(ip)
+            all_avg[ip] = NodeInfo(dict(devs), devs[0], rpc.TCPClient(ip)) 
#Ntk(ip)
         return all_avg
Index: pyntk/ntk/lib/microsock.py
===================================================================
--- pyntk/ntk/lib/microsock.py  (revision 1362)
+++ pyntk/ntk/lib/microsock.py  (working copy)
@@ -135,7 +135,7 @@
 
     def __del__(self):
         # Close dispatcher if it isn't already closed
-        if self.dispatcher._fileno is not None:
+        if self.dispatcher.fileno() is not None:
             try:
                 self.dispatcher.close()
             finally:
Index: pyntk/ntk/ntkd.py
===================================================================
--- pyntk/ntk/ntkd.py   (revision 1362)
+++ pyntk/ntk/ntkd.py   (working copy)
@@ -82,7 +82,7 @@
 
     def load_nics(self, opt):
         if type(opt.nics) == str:
-                opt.nics=[opt.nics]
+                self.nics=[opt.nics]
         if self.simulated:
                 self.nics = nic.SimNicAll()
         else:
_______________________________________________
Netsukuku mailing list
[email protected]
http://lists.dyne.org/mailman/listinfo/netsukuku

Reply via email to