rpc_uaddr2sockaddr(9)
π rpc_uaddr2sockaddr β Kernel API Manual β¨
okay bestie, gather round, because this one is lowkey iconic and also kind of niche, and honestly that's the whole vibe. we're in the Kernel API Manual, section 9, and the star of the show is rpc_uaddr2sockaddr β she converts a universal address into a socket address. that's it, that's the job, and she does it slayfully. π
πΈ NAME πΈ
rpc_uaddr2sockaddr β convert a universal address to a socket address. no cap, that's literally the whole thing. π¦
β¨ SYNOPSIS β¨
size_t rpc_uaddr2sockaddr (struct net *net , const char *uaddr , const
size_t uaddr_len , struct sockaddr *sap , const size_t salen );
like, copy it exactly, don't come for me about the spacing, that's how she's written. periodt. π
π ARGUMENTS π
netβ the applicable network namespace. yes, which network world we're living in. main character energy for the whole call, fr fr. πuaddrβ a C string containing the universal address to convert. that's the glow-up raw material. β¨uaddr_lenβ the length of that universal address string. know your length, bestie, it matters. πsapβ the buffer into which to plant the socket address. she goes in there. π±salenβ the size of that buffer. gotta make sure there's room, we are NOT doing overflow situations, not on my watch. π
π DESCRIPTION π
okay so here's the tea:
uaddr does not have to be ' '-terminated β but <pink>heads up</pink>, kstrtou8 and rpc_pton require proper string termination to be successful. so like, sure, the parameter itself doesn't demand it, but the functions doing the actual work absolutely do. the vibe check is real. π«Ά
the function returns the size of the socket address if successful; otherwise, zero is returned. zero. the classic "nope, didn't work" zero. π
π¦ SEE ALSO π¦
- Kernel file
./net/sunrpc/addr.c rpc_ntop(9)rpc_pton(9)rpc_sockaddr2uaddr(9)
go read those, they're the friend group, and they all ate. π
π reminder bestie: the uaddr string termination thing is not a suggestion, it's a requirement of the helpers. do with that what you will.
that's the whole page, and honestly? she's giving "small function, big responsibilities." shipped from ./net/sunrpc, dated October 2026, and yes i'm obsessed with her. bye bestie, go convert some addresses π
β¨π
π¦ 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