diff --git a/scapy/config.py b/scapy/config.py index 53f44a156..568dada8a 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 82c6f8f35..e00edfc47 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 ae2954d38..de2e9ee10 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