dhcpv6: run only for masquerade
The VIF contains the information passed to the dhcp server.
If the VIF doesn't have ipv6 information, dhcpv6 won't run.
Currently, only masquerade binding sets ipv6 information on the VIF
since ipv6 is not supported for bridge binding.
@@ -367,15 +367,17 @@ func (h *NetworkUtilsHandler) StartDHCP(nic *VIF, serverAddr net.IP, bridgeInter
}
}()
+ if nic.IPv6.IPNet != nil {
go func() {
if err = DHCPv6Server(
nic.IPv6.IP,
bridgeInterfaceName,
); err != nil {
- log.Log.Errorf("failed to run DHCP: %v", err)
+ log.Log.Reason(err).Error("failed to run DHCPv6")
panic(err)
}
}()
+ }
return nil
}
