Skip to content

Conversation

@behzad-mir
Copy link
Contributor

@behzad-mir behzad-mir commented May 29, 2025

The CNS code currently will call to the net.InterfaceByName(LoopbackAdapterHostNCConnectivity) to check for the existing Loopback interface when the Loopback adapter has not been created for Apipa HNSNetwork. This change will make CNS to also check for existence of the interface: "vEthernet (LoopbackAdapterHostNCConnectivity)" in case that HNSNetwork Has not been rehydrated, and the loopback interface is leaked.

Reason for Change:

Issue Fixed:

Requirements:

Notes:

Copilot AI review requested due to automatic review settings May 29, 2025 19:45
@behzad-mir behzad-mir requested a review from a team as a code owner May 29, 2025 19:45
@behzad-mir behzad-mir requested a review from rbtr May 29, 2025 19:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the loopback adapter name used in CNS to explicitly reference the vEthernet adapter when checking for the existence of the required network interface.

  • Updated the loopback adapter name constant to "vEthernet (LoopbackAdapterHostNCConnectivity)".
  • Modified the interface existence check to use the updated constant.
Comments suppressed due to low confidence (1)

cns/hnsclient/hnsclient_windows.go:57

  • [nitpick] Consider renaming 'vEthernethostNCLoopbackAdapterName' to 'vEthernetHostNCLoopbackAdapterName' for improved readability and consistent camel casing relative to the previously defined 'hostNCLoopbackAdapterName'.
vEthernethostNCLoopbackAdapterName = "vEthernet (LoopbackAdapterHostNCConnectivity)"

@behzad-mir behzad-mir force-pushed the v1.6.11-hotfix.20250529 branch from bf4b418 to 16e2cde Compare May 29, 2025 19:47
@behzad-mir behzad-mir added cns Related to CNS. bug and removed do-not-merge labels May 29, 2025
@behzad-mir behzad-mir force-pushed the v1.6.11-hotfix.20250529 branch from 16e2cde to c1c1c4e Compare May 29, 2025 23:45
@behzad-mir behzad-mir requested a review from rbtr May 29, 2025 23:57
msvik
msvik previously approved these changes May 30, 2025
@behzad-mir behzad-mir force-pushed the v1.6.11-hotfix.20250529 branch from c1c1c4e to d3c9b1f Compare May 30, 2025 18:49
@behzad-mir behzad-mir requested review from msvik and tamilmani1989 May 30, 2025 18:49
@behzad-mir behzad-mir force-pushed the v1.6.11-hotfix.20250529 branch 2 times, most recently from a1cd2d8 to 6dc6e58 Compare May 30, 2025 20:17
…checking for existance of loopback adapter for Apipa network Creation.
@behzad-mir behzad-mir force-pushed the v1.6.11-hotfix.20250529 branch from 6dc6e58 to eb0cd87 Compare May 30, 2025 21:05
Copy link
Contributor

@santhoshmprabhu santhoshmprabhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add a UT?

Copy link
Contributor

@santhoshmprabhu santhoshmprabhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to expedite fix for Sev2, tests to be added in follow up.

@behzad-mir
Copy link
Contributor Author

Can we please add a UT?

Will do a UT on a follow up PR

@behzad-mir behzad-mir enabled auto-merge May 30, 2025 22:10
@rbtr
Copy link
Collaborator

rbtr commented May 30, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr requested a review from Copilot May 30, 2025 22:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the wrong network interface name was used when checking for existing loopback adapters in the CNS code. Key changes include introducing a new constant for the vEthernet loopback adapter name and updating the interface existence check to cover both adapter naming schemes.

Comments suppressed due to low confidence (1)

cns/hnsclient/hnsclient_windows.go:57

  • [nitpick] The constant name 'vEthernethostNCLoopbackAdapterName' could be improved for clarity and consistency; consider renaming it to 'vEthernetHostNCLoopbackAdapterName'.
vEthernethostNCLoopbackAdapterName = "vEthernet (" + hostNCLoopbackAdapterName + ")"

Copilot AI added a commit that referenced this pull request May 30, 2025
@behzad-mir behzad-mir added this pull request to the merge queue May 30, 2025
Merged via the queue into master with commit 4f9a4d0 May 31, 2025
15 of 16 checks passed
@behzad-mir behzad-mir deleted the v1.6.11-hotfix.20250529 branch May 31, 2025 00:37
sivakami-projects pushed a commit that referenced this pull request Oct 23, 2025
#3693)

fix: use "vEthernet (LoopbackAdapterHostNCConnectivity)" when CNS is checking for existance of loopback adapter for Apipa network Creation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cns Related to CNS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants