Add support for CGROUP_ID to inet_diag_message and fix type for CLASS_ID #1092
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I currently use
inet_diag_msg
to look up the class id of sockets from the application's net_cls cgroup and I've been decoding the hex string, but always meant to make a PR to fix it to be uint32. I'm now upgrading the system to cgroup v2, so I need to move to cgroup id instead which required adding additional fields.You can see where these are set upstream in the kernel here: https://github.com/torvalds/linux/blob/ac9a78681b921877518763ba0e89202254349d1b/net/ipv4/inet_diag.c#L170-L177
These fields are populated when you request the TCLASS extension.