Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bridge: remove useless code #962

Merged
merged 3 commits into from
Nov 13, 2023

Conversation

arthur-zhang
Copy link
Contributor

@arthur-zhang arthur-zhang commented Oct 23, 2023

gws.defaultRouteFound is always false.
firstV4Addr it is declared but not used anywhere in the code.

@arthur-zhang arthur-zhang changed the title bridge: remove useless check bridge: remove useless code Oct 26, 2023
@squeed squeed requested a review from maiqueb October 30, 2023 15:15
@arthur-zhang
Copy link
Contributor Author

help wanted, seems ci is broken.

@maiqueb
Copy link
Contributor

maiqueb commented Nov 2, 2023

help wanted, seems ci is broken.

The issue you're complaining about was fixed in #967

Please rebase latest main branch, it should be OK then.

Copy link
Contributor

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

Good catch.

Thanks for cleaning up the code base.
You'll need to rebase the latest main branch; that should take care of the lint errors causing CI to fail.

@arthur-zhang arthur-zhang requested a review from maiqueb November 2, 2023 09:17
@s1061123
Copy link
Contributor

/lgtm

@squeed squeed enabled auto-merge November 13, 2023 16:10
gws.defaultRouteFound here is always false.

Signed-off-by: arthur-zhang <[email protected]>
Signed-off-by: arthur-zhang <[email protected]>
@@ -240,7 +240,7 @@ func calcGateways(result *current.Result, n *NetConf) (*gwInfo, *gwInfo, error)

// Add a default route for this family using the current
// gateway address if necessary.
if n.IsDefaultGW && !gws.defaultRouteFound {
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure this is NOP? At this point gws refers to a global defined at the top of the function:

	gwsV4 := &gwInfo{}
	gwsV6 := &gwInfo{}

So if there are multiple v4/v6 addresses, I think defaultRouteFound would carry across the IP addressing loop. I think we need to keep this?

@squeed squeed merged commit e82848a into containernetworking:main Nov 13, 2023
5 checks passed
@s1061123
Copy link
Contributor

@dcbw I understood that. That is right that gws is used in calcGateways(). Let me double check that in #980

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants