Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_packages_modules_Connectivity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LMODroid
platform_packages_modules_Connectivity
Commits
5fb3e6de
Commit
5fb3e6de
authored
1 year ago
by
Lorenzo Colitti
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Add an idea for how we could reduce the netId size in the future." into main
parents
10c33ca5
f7a9803e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
service/src/com/android/server/NetIdManager.java
+10
-0
10 additions, 0 deletions
service/src/com/android/server/NetIdManager.java
with
10 additions
and
0 deletions
service/src/com/android/server/NetIdManager.java
+
10
−
0
View file @
5fb3e6de
...
...
@@ -27,6 +27,16 @@ import com.android.internal.annotations.VisibleForTesting;
* Class used to reserve and release net IDs.
*
* <p>Instances of this class are thread-safe.
*
* NetIds are currently 16 bits long and consume 16 bits in the fwmark.
* The reason they are large is that applications might get confused if the netId counter
* wraps - for example, Network#equals would return true for a current network
* and a long-disconnected network.
* We could in theory fix this by splitting the identifier in two, e.g., a 24-bit generation
* counter and an 8-bit netId. Java Network objects would be constructed from the full 32-bit
* number, but only the 8-bit number would be used by netd and the fwmark.
* We'd have to fix all code that assumes that it can take a netId or a mark and construct
* a Network object from it.
*/
public
class
NetIdManager
{
// Sequence number for Networks; keep in sync with system/netd/NetworkController.cpp
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment