[dua] handle AddressError (#5516)

This commit enhances DUA feature to handle Address Error by increasing
the DAD counter and generating new DUA address if a DUA conflict is
detected.
This commit is contained in:
Simon Lin
2020-09-27 11:32:33 -07:00
committed by GitHub
parent f013a30409
commit fad92841e7
7 changed files with 198 additions and 10 deletions
+15
View File
@@ -959,6 +959,16 @@ class NodeImpl:
self.send_command('routerdowngradethreshold')
return int(self._expect_result(r'\d+'))
def set_router_eligible(self, enable: bool):
cmd = f'routereligible {"enable" if enable else "disable"}'
self.send_command(cmd)
self._expect('Done')
def get_router_eligible(self) -> bool:
states = [r'Disabled', r'Enabled']
self.send_command('routereligible')
return self._expect_result(states) == 'Enabled'
def prefer_router_id(self, router_id):
cmd = 'preferrouterid %d' % router_id
self.send_command(cmd)
@@ -1007,6 +1017,11 @@ class NodeImpl:
self.send_command(cmd)
self._expect('Done')
def del_ipaddr(self, ipaddr):
cmd = 'ipaddr del %s' % ipaddr
self.send_command(cmd)
self._expect('Done')
def add_ipmaddr(self, ipmaddr):
cmd = 'ipmaddr add %s' % ipmaddr
self.send_command(cmd)