-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
net/portmapper: handle multiple UPnP discovery responses #10623
Conversation
Reviewer note: the diff doesn't do a good job at capturing it, but there's not as much code changed as it seems. Most of |
ca49466
to
3cce092
Compare
// NOTE: this time might not technically be accurate if we created a | ||
// permanent lease above, but we should still re-check the presence of | ||
// the lease on a regular basis so we use it anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we try to make a permanent lease? I think it would be better to always try to make one that expires.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We always try a temporary lease first, but some UPnP implementations don't support that. In those cases, we fall back to a permanent lease, though we still explicitly remove that lease when we're not using it.
3cce092
to
b6ecbf2
Compare
Switched away from a channel to an |
b6ecbf2
to
3668c59
Compare
Instead of taking the first UPnP response we receive and using that to create port mappings, store all received UPnP responses, sort and deduplicate them, and then try all of them to obtain an external address. Updates #10602 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I783ccb1834834ee2a9ecbae2b16d801f2354302f
3668c59
to
5ec011e
Compare
Testing notes: tested on a networking running an eero device as the main router, along with a network running a Linux server with MiniUPnPd 2.3.3 as the router. Both networks were still able to obtain a portmap, and on the second network, deduplicated the returned UPnP responses successfully:
|
Instead of taking the first UPnP response we receive and using that to create port mappings, store all received UPnP responses, sort and deduplicate them, and then try all of them to obtain an external address.
Updates #10602
Change-Id: I783ccb1834834ee2a9ecbae2b16d801f2354302f