diff --git a/scapy/config.py b/scapy/config.py index 53f44a1566a98cc0fb503ba2119f559031221643..568dada8a60cb3e45a0efa8d69779ec169db9e01 100755 --- a/scapy/config.py +++ b/scapy/config.py @@ -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: diff --git a/scapy/route6.py b/scapy/route6.py index 82c6f8f350ea13d621d24775660775df42140012..e00edfc4757ba8d9e43dcbc17a96dd0ebfea70d5 100644 --- a/scapy/route6.py +++ b/scapy/route6.py @@ -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. """ diff --git a/test/regression.uts b/test/regression.uts index ae2954d38f999df35f66f6c6382a77e3584ea21f..de2e9ee106a834c948c83d59c9a7574d591004a0 100644 --- a/test/regression.uts +++ b/test/regression.uts @@ -67,6 +67,11 @@ if len(routes6): else: True += Test ifchange() +conf.route6.ifchange(LOOPBACK_NAME, "::1/128") +True + + ############ ############ + Basic tests