-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
lib/pmp: Add NAT-PMP support (ref #698) #2968
Conversation
By the way, there is one change in behaviour with the bigger refactor. Instead of sending 0.0.0.0:(extPort), we now send (extIp):(extPort), but I think that's fine. |
Cool. I have a decommissioned airport express somewhere I'll dig out to take this for a spin |
Updated my comment above due to markdown errors |
\o/ There's a couple of PNP/PMP spellos tho - fix those, and good to go I think! |
Eh, wait. |
Hm. Looks like we in fact did ask for a good port number. I wonder if this is a bug in miniupnpd's NAT-PMP stack. Packet trace says we are asking for the right thing, and it responds with gobbledygook.
Indeed 242 == 22002 % 256, 14 == 28174 % 256. So something is only interpreting the low order bits. And I'm not sure about the lifetime, I would expect it to be in seconds, but from our code it looks like we should correctly ask for a 60 minute lease... |
I think the bugs are on the other side until someone proves otherwise. Another thing though:
Should we speak both UPnP and NAT-PMP with the same device? Perhaps we should stick to just one protocol per gateway IP? |
Oh and we do apparently default to a one minute lease renewal. Is that intentional - it seems a bit excessive? |
If the lease time is 0 (permanent) it uses renewal interval. We ask for a specific port, but might get something else if the router decides so. Regarding two port mappings on the same router, I don't think its a problem, it's yet another way to connect. |
So I think the only actionable point in my tirade above is a replace PNP -> PMP in a couple of log lines |
711a1cf
to
54dd6c7
Compare
Fixed the typo |
54dd6c7
to
f4cf299
Compare
Did you set the renewal interval to 1m to get the 1 minute renewals? |
Not intentionally, no. This was on the h1 or h2 config in the test dir, with the listen address opened up to 0.0.0.0 and then auto migrated from whatever version it is now. |
@st-review merge. for great justice! |
🕐 Build status is |
👌 Merged as c49453c. Thanks, @AudriusButkevicius! |
so I am suspicious of the fact that it was only 1 minute. |
Yeah I'll look into it again but if anything it comes from the lib/nat commit so doesn't taint this one i think. |
|
Well the mystery solved :) |
Purpose
Add NAT-PMP support
Testing
None, someone with a NAT-PMP gateway available needs to test it.