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

Fixed bug for inbound connections gated by the deprecated filter option #1004

Merged

Conversation

jalextowle
Copy link
Contributor

@jalextowle jalextowle commented Sep 11, 2020

Partially fixes: #1002

options_test.go Outdated Show resolved Hide resolved
@aarshkshah1992
Copy link
Contributor

@jalextowle LGTM modulo test refactor.

func (f *filtersConnectionGater) InterceptAccept(_ network.ConnMultiaddrs) (allow bool) {
return true
func (f *filtersConnectionGater) InterceptAccept(connAddr network.ConnMultiaddrs) (allow bool) {
return !(*ma.Filters)(f).AddrBlocked(connAddr.RemoteMultiaddr())
Copy link
Collaborator

Choose a reason for hiding this comment

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

@aarshkshah1992 is this the only place to do this? Don't we need something for at least InterceptSecured if not InterceptUpgraded also?

Copy link
Contributor

@aarshkshah1992 aarshkshah1992 Sep 15, 2020

Choose a reason for hiding this comment

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

@aschmahmann

An InterceptUpgraded wont do match for us here as all those rejections will happen in InterceptAccepted also(an incoming connection is first accepted and then secured). We didn't have the notion of rejecting connections at different "lifecycle states" when we had this old filter.

However, there is no harm in doing so and I am okay either ways.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually @aschmahmann , we might need this for QUIC. Thanks for catching this.

@jalextowle Please can you add a similar behaviour to InterceptSecured as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aarshkshah1992 Yep, I added that behavior.

@aarshkshah1992 aarshkshah1992 self-requested a review September 16, 2020 05:06
@aarshkshah1992 aarshkshah1992 merged commit 636d078 into libp2p:master Sep 16, 2020
@aschmahmann aschmahmann mentioned this pull request Feb 18, 2021
73 tasks
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.

filtersConnectionGater not processing inbound connections
3 participants