procfs icon indicating copy to clipboard operation
procfs copied to clipboard

In the UnixNetEntry structure there are missing fields

Open acsecengtesting opened this issue 1 year ago • 3 comments

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 :)

acsecengtesting avatar Jul 11 '24 16:07 acsecengtesting

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 avatar Jul 31 '24 02:07 eminence

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!

Hwatwasthat avatar Aug 05 '24 09:08 Hwatwasthat

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

eminence avatar Aug 22 '24 02:08 eminence