skb_copy_and...datagram_msg(9)
π skb_copy_and_csum_datagram_msg β Kernel API Manual π
okay bestie, welcome to the skb_copy_and...datagram_msg(9) page, like the actual kernel API manual entry for skb_copy_and_csum_datagram_msg. yes the title got truncated with dots, that's just how the man page shows it, we don't fix it, we respect it β¨
πΈ NAME πΈ
skb_copy_and_csum_datagram_msg β literally does what it says on the tin: copy an skb over to a user iovec and checksum it at the same time. two jobs, one function, main character energy π
β¨ SYNOPSIS β¨
int skb_copy_and_csum_datagram_msg (struct sk_buff *skb , int hlen ,
struct msghdr *msg );
that's the whole vibe check right there π«Ά three args, returns an int.
π ARGUMENTS π
skbβ the skbuff in question, the little packet bb itself π¦hlenβ the hardware length, yes that's what it is, don't come for memsgβ the destination, like where it's all going π―
π DESCRIPTION π
okay so this is the important part and I need you to lock in: the Caller _must_ check that skb will fit to this iovec. not "should", not "maybe", must. that underscore emphasis is in the original and it's there for a REASON π this is one of those things where if you skip it, that's on you, not on the function π
β RETURN β
0β success, we ate, no notes π-EINVALβ checksum failure π something didn't add up (literally)-EFAULTβ fault during copy π§οΈ the copy went sideways
π SEE ALSO π
Kernel file ./net/core/datagram.c and honestly the whole friend group:
__skb_try_recv_datagram(9)skb_kill_datagram(9)skb_copy_and_crc32c_datagram_iter(9)skb_copy_datagram_iter(9)skb_copy_datagram_from_iter(9)zerocopy_sg_from_iter(9)skb_copy_and_csum_datagram(9)datagram_poll_queue(9)datagram_poll(9)
not me ending the page but like, go read those too, iykyk π§
and that's the whole thing bestie!! this page lives under ./net/core and it's dated October 2026 in the Kernel API Manual β so yeah, freshly stamped, iconic, periodt πππ₯
π¦ 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