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

In the UnixNetEntry structure there are missing fields #312

Open
acsecengtesting opened this issue Jul 11, 2024 · 3 comments
Open

In the UnixNetEntry structure there are missing fields #312

acsecengtesting opened this issue Jul 11, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@acsecengtesting
Copy link

In procfs on Linux - Num RefCount Protocol Flags Type St Inode Path

The docs say
#[non_exhaustive]
pub struct UnixNetEntry {
pub ref_count: u32,
pub socket_type: u16,
pub state: UnixState,
pub inode: u64,
pub path: Option<PathBuf>,
}

What is the best way to get the additional fields added? I'm mainly interested in Flags. Happy to do some legwork but am not an experienced rust developer so might need a bit of help :)

@eminence
Copy link
Owner

Hi, can you give an example of a /proc/net/unix with some non-zero flags? Adding support to the Flags field should be pretty easy, but this field seems to be zero on all my machines. So having a version with non-zery entries will help when writing tests for this

@eminence eminence added the good first issue Good for newcomers label Jul 31, 2024
@Hwatwasthat
Copy link
Contributor

The set of potential flags appear to be here: https://elixir.bootlin.com/linux/v6.10.2/source/include/net/sock.h#L916. I haven't seen any flags set on my system but did see a stackoverflow post where one was set. Still seems quite rare though (at least in the limited boxes I have to look at).

I'd be willing to look at adding this in, if my poking about hadn't hinted at it!

@eminence
Copy link
Owner

ah, well having the a link to the source is great. I'd still like to see some real examples, if possible. Or a mini-research project for someone could be to figure out how to generate a unix socket with a non-zero flag. I'd be happy to accept a PR to add this field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants