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

Beware of reserved ports on Android #2

Open
aaaaalbert opened this issue Feb 3, 2017 · 0 comments
Open

Beware of reserved ports on Android #2

aaaaalbert opened this issue Feb 3, 2017 · 0 comments

Comments

@aaaaalbert
Copy link

Not all unprivileged ports on Android are free for server use by our application. This isn't a big deal for experiments (which resort to 63100-63199 in the ephemeral range anyway), but the nodemanager and its modules must be careful. For example, my Nexus 6 with Android 7.1.1. disallows port 34612 that we use for time updates throughout, and raises CleanupInProgressError.

I went and enumerated all UDP and TCP ports by trying to listen on them. For every line, the status is valid for all ports starting at that number and up to (but excluding) the number on the next line.

UDP:
bad 1
good 1024
bad 5060
good 5061
bad 5353
good 5354
bad 32000
good 32012
bad 32013
good 37000
bad 50010
good 50061

TCP:
bad 1
good 1024
bad 5060
good 5061
bad 32000
good 32012
bad 32013
good 37000
bad 41852
good 41853
bad 42498
good 42499
bad 50010
good 50061

For comparison, procfs on the device tells us that

$ cat /proc/sys/net/ipv4/ip_local_port_range
37000	50000
$ cat /proc/sys/net/ipv4/ip_local_reserved_ports
5060,32000-32011,32013-36999,50010-50060

In case you wonder, 1-1023 is the privileged port range; 5060 is used for SIP, 5353/UDP for Bonjour. I don't know about the others.

aaaaalbert added a commit that referenced this issue Feb 3, 2017
See #2 for details on disallowed ports on Android.
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

No branches or pull requests

1 participant