+ self.dhclientcmd.start(ifaceobj.name, wait=wait,
+ cmd_prefix=dhclient_cmd_prefix)
+ if 'inet6' in ifaceobj.addr_family:
+ if dhclient6_running:
+ self.logger.info('dhclient6 already running on %s. '
+ 'Not restarting.' % ifaceobj.name)
+ else:
+ accept_ra = ifaceobj.get_attr_value_first('accept_ra')
+ if accept_ra:
+ # XXX: Validate value
+ self.sysctl_set('net.ipv6.conf.%s' %ifaceobj.name +
+ '.accept_ra', accept_ra)
+ autoconf = ifaceobj.get_attr_value_first('autoconf')
+ if autoconf:
+ # XXX: Validate value
+ self.sysctl_set('net.ipv6.conf.%s' %ifaceobj.name +
+ '.autoconf', autoconf)
+ try:
+ self.dhclientcmd.stop6(ifaceobj.name)
+ except:
+ pass
+ #add delay before starting IPv6 dhclient to
+ #make sure the configured interface/link is up.
+ if ll_wait_time:
+ timeout = ll_wait_time
+ time.sleep(1)
+ else:
+ timeout = ll_wait_time+1
+
+ while timeout:
+ addr_output = utils.exec_command('%s -6 addr show %s'
+ %(utils.ip_cmd, ifaceobj.name))
+ r = re.search('inet6 .* scope link', addr_output)
+ if r:
+ self.dhclientcmd.start6(ifaceobj.name,
+ wait=wait,
+ cmd_prefix=dhclient_cmd_prefix)
+ return
+ timeout -= 1
+ if timeout:
+ time.sleep(1)
+