skb_gso_transport_seglen(9)
π skb_gso_transport_seglen(9) β the Kernel API Manual, bestie edition β¨
okay so this whole page lives in the Kernel API Manual, and the star of the show is skb_gso_transport_seglen. yes it's a mouthful, no we're not changing it, it's iconic π
β¨ NAME β¨
skb_gso_transport_seglen β returns the length of the individual segments of a gso packet π¦
like literally, that's her whole job. one (1) job. and she eats every time π
πΈ SYNOPSIS πΈ
unsigned int skb_gso_transport_seglen (const struct sk_buff *skb );
main character signature ngl β she takes one const struct sk_buff *skb and hands you back an unsigned int π«Ά
π ARGUMENTS π
skbβ the GSO skb π that's it, that's the argument. one (1) skb, the GSO kind, she's not picky but she IS specific.
π DESCRIPTION π
okay so here's the vibe: skb_gso_transport_seglen is the one you call when you need to figure out the real size of the individual segments π₯ β and that includes the Layer4 headers (TCP/UDP) too. so if you were wondering "does she count the transport header," yes bestie, she counts the transport header. slay.
but β and this is the important part β the MAC/L2 headers and the network headers (IP, IPv6) are not accounted for βπΏ. she does not know them. she does not claim them. she is not about that life.
so like, real size of the segment = L4 headers in, L2/network headers out. do not come for her about the IP header, it's simply not on her radar π
π¦ SEE ALSO π¦
go give these siblings some love, they're all family fr fr:
- Kernel file
./net/core/gso.c skb_eth_gso_segment(9)skb_mac_gso_segment(9)__skb_gso_segment(9)skb_gso_network_seglen(9)skb_gso_mac_seglen(9)skb_gso_size_check(9)skb_gso_validate_network_len(9)skb_gso_validate_mac_len(9)
and that's the page π before you go: this little gem lives tucked inside ./net/core, dated October 2026 β so go forth, count your transport segment lengths, and remember β L2 and network headers were never invited to this party. 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