skb_copy_and_csum_datagram(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– skb_copy_and_csum_datagram(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” yes we are literally in the kernel rn, put your hair up, it's giving main character energy πŸŽ€

✨ NAME ✨

skb_copy_and_csum_datagram β€” copy a datagram into an iovec iterator and update a checksum at the same time. two jobs, one function, she's multitasking and we love her for it πŸ’…


🌸 SYNOPSIS 🌸

int skb_copy_and_csum_datagram (const struct sk_buff *skb , int offset ,
       struct iov_iter *to , int len , __wsum *csump );

no cap, that's the whole signature. five args, returns an int. she's not complicated, she's just precise πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the buffer to copy from. she's the source of truth, the moment, the origin story ✨
  • offset β€” where in the buffer to start copying from. like skipping the intro of a song, except it's bytes 🎡
  • to β€” the iovec iterator you're copying into. the destination. the final form. the glow-up πŸ’«
  • len β€” how much data to copy from the buffer to the iovec. this is the amount, okay, respect the amount πŸ™ˆ
  • csump β€” checksum pointer. she gets updated along the way, she's doing the most and honestly? iconic πŸ‘‘

🫢 SEE ALSO 🫢

all the siblings and neighbors, fr fr β€” they all live in the kernel file ./net/core/datagram.c:

go read them, iykwim πŸ˜ŒπŸ“š


lowkey reminder: csump is a pointer, so she's updating checksum state through it. don't ignore her, she's the whole point of the "and csum" part πŸ’€

🌈 mwah, that's the page! this lil beauty lives in ./net/core and the source/version line says October 2026 β€” so yes, she's dated, she's documented, she's slaying. bye bestie, go checksum something πŸ“πŸ’œπŸ§š

πŸ“¦ where this page comes from