mirror of https://github.com/secdev/scapy.git
Fix & test Route6.ifchange()
This commit is contained in:
parent
a0821eb475
commit
300e96a7c5
|
@ -172,6 +172,8 @@ class CacheInstance(dict):
|
|||
self.timeout = timeout
|
||||
self.name = name
|
||||
self._timetable = {}
|
||||
def flush(self):
|
||||
self.__init__(name=self.name, timeout=self.timeout)
|
||||
def __getitem__(self, item):
|
||||
val = dict.__getitem__(self,item)
|
||||
if self.timeout is not None:
|
||||
|
|
|
@ -128,11 +128,11 @@ class Route6:
|
|||
if iface != iff:
|
||||
continue
|
||||
if gw == '::':
|
||||
self.routes[i] = (the_net,the_plen,gw,iface,the_addr)
|
||||
self.routes[i] = (the_net,the_plen,gw,iface,[the_addr])
|
||||
else:
|
||||
self.routes[i] = (net,the_plen,gw,iface,the_addr)
|
||||
self.routes[i] = (net,plen,gw,iface,[the_addr])
|
||||
self.invalidate_cache()
|
||||
ip6_neigh_cache.flush()
|
||||
conf.netcache.in6_neighbor.flush()
|
||||
|
||||
def ifdel(self, iff):
|
||||
""" removes all route entries that uses 'iff' interface. """
|
||||
|
|
|
@ -67,6 +67,11 @@ if len(routes6):
|
|||
else:
|
||||
True
|
||||
|
||||
= Test ifchange()
|
||||
conf.route6.ifchange(LOOPBACK_NAME, "::1/128")
|
||||
True
|
||||
|
||||
|
||||
############
|
||||
############
|
||||
+ Basic tests
|
||||
|
|
Loading…
Reference in New Issue