sel_netport_find(9)
π sel_netport_find(9) β like, the port-lookup queen π
okay so bestie, welcome to the Kernel API Manual β¨ (that's the manual name, we're saying hi to it early, mwah). This is sel_netport_find(9) and honestly? She's short, she's sweet, she does exactly one thing and does it flawlessly. Main character energy fr fr π
πΈ NAME πΈ
sel_netport_find β Search for a port record π
No cap, that's the whole gig. She searches. She finds (maybe). Iconic.
β¨ SYNOPSIS β¨
struct sel_netport * sel_netport_find (u8 protocol , u16 pnum );
Look at that signature. Immaculate. Two args, one pointer back, no drama π
π¦ ARGUMENTS π¦
protocolβ the protocol, bestie. That's it, that's the arg π«Άpnumβ the port πΈ
(Yeah the originals are terse, but we're keeping every word of the meaning: protocol is the protocol and pnum is the port. Nothing invented, nothing dropped. iykyk π)
π DESCRIPTION π
So what she actually does: sel_netport_find searches the network port table and returns the matching record. That's the vibe check β you hand her a protocol and a port, she goes digging in the table, and if your entry is there? Slay. She returns it. π
But listen β and this is the important part β if an entry can not be found in the table, she returns NULL. Not an error code, not a sad little struct, just NULL. So like... check for that. Always check for that. Not me being dramatic, it's literally in the spec π
π SEE ALSO π
- Kernel file
./security/selinux/netport.c sel_netport_hashfn(9)sel_netport_insert(9)sel_netport_sid_slow(9)sel_netport_sid(9)sel_netport_flush(9)
The whole netport friend group π§ go read them, they're all linked together, it's giving found family π
lowkey a tiny function, highkey important β remember the NULL return, bestie, or your code's gonna have a bad time π
and that's the page!! π brought to you by ./security/selinux, dated October 2026, and yes she's serving sel_netport_find(9) in the footer like the queen she is π₯ mwah, go write some secure code πβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms