ipv4_pktinfo_prepare(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

ipv4_pktinfo_prepare(9) πŸ’…βœ¨

okay so this is a Kernel API Manual page, and it's literally about transferring some info from rtable to skb. bestie, it's giving low-level kernel realness 🫢


🌸 NAME 🌸

ipv4_pktinfo_prepare β€” transfer some info from rtable to skb πŸ’–


✨ SYNOPSIS ✨

the whole mood, signature-wise:

void ipv4_pktinfo_prepare (const struct sock *sk , struct sk_buff *skb ,
       bool drop_dst );

πŸŽ€ ARGUMENTS πŸŽ€

  • sk β€” socket. that's the socket bestie, no cap 🧚
  • skb β€” buffer. the packet buffer, the little carry-on πŸ¦‹
  • drop_dst β€” if true, drops skb dst. yes literally: true means the skb dst gets dropped πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

okay so to support the IP_CMSG_PKTINFO option, we store rt_iif and the specific destination in skb->cb[] before dst drop. that's the whole move ✨

the way this slays: the receiver doesn't make cache line misses to read rtable. no cap, it's a whole performance vibe πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

go look at the kernel file ./net/ipv4/ip_sockglue.c β€” that's the reference, iykyk πŸ‘‘


xoxo kernel bestie πŸ’– sourced from ./net/ipv4, dated October 2026, page ipv4_pktinfo_prepare(9) β€” periodt. 🌈

πŸ“¦ where this page comes from