File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ const (
5353 // Name of the loopback adapter needed to create Host NC apipa network
5454 hostNCLoopbackAdapterName = "LoopbackAdapterHostNCConnectivity"
5555
56+ // Name of the loopback adapter created by HNS for Host NC apipa network
57+ vEthernethostNCLoopbackAdapterName = "vEthernet (" + hostNCLoopbackAdapterName + ")"
58+
5659 // HNS rehydration issue requires this GW to be different than the loopback adapter ip, so we set it to .2
5760 defaultHnsGwIPAddress = "169.254.128.2"
5861 hnsLoopbackAdapterIPAddress = "169.254.128.1"
@@ -301,7 +304,11 @@ func createHostNCApipaNetwork(
301304 }
302305
303306 // Create loopback adapter needed for this HNS network
304- if interfaceExists , _ := networkcontainers .InterfaceExists (hostNCLoopbackAdapterName ); ! interfaceExists {
307+ // We need to fitst check the existence of either "LoopbackAdapterHostNCConnectivity" or the vEthernet(LoopbackAdapterHostNCConnectivity) interfaces
308+ // If neither exists, we create the loopback adapter with the specified IP configuration.
309+ loopbackInterfaceExists , _ := networkcontainers .InterfaceExists (hostNCLoopbackAdapterName )
310+ vethernetLoopbackInterfaceExists , _ := networkcontainers .InterfaceExists (vEthernethostNCLoopbackAdapterName )
311+ if ! loopbackInterfaceExists && ! vethernetLoopbackInterfaceExists {
305312 ipconfig := cns.IPConfiguration {
306313 IPSubnet : cns.IPSubnet {
307314 IPAddress : hnsLoopbackAdapterIPAddress ,
You can’t perform that action at this time.
0 commit comments