IPV6_RECVPKTINFO(2const)

πŸ“¦
version 6.20 Β· 4 versions
, in arch rolling, nixpkgs unstable

πŸ’– IPV6_RECVPKTINFO πŸ’–

okay bestie, so you're reading the IPV6_RECVPKTINFO page from the man-pages section 2const, and honestly? it's a short one, but it's so useful, trust. it lives in the Standard C library (libc, -lc) and it's all about making your incoming datagrams spill the tea about where they came from. let's get into it 🫢


✨ NAME ✨

IPV6_RECVPKTINFO β€” set delivery of the IPV6_PKTINFO control message on incoming datagrams

like. the name literally ate. it tells the kernel "hey bestie, when datagrams roll up to my socket, pls also send me the IPV6_PKTINFO control message." 🌸


🌈 LIBRARY 🌈

Standard C library (libc, -lc)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>

int setsockopt(int sockfd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
               const int *enable, sizeof(int));

no cap, that's the whole vibe. you're calling setsockopt() with IPPROTO_IPV6 as the level and IPV6_RECVPKTINFO as the option name, and you hand it a pointer to an int named enable plus sizeof(int). πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

Set delivery of the IPV6_PKTINFO control message on incoming datagrams. πŸŽ€

Such control messages contain a struct in6_pktinfo, as per RFC 3542.

Allowed only for SOCK_DGRAM or SOCK_RAW sockets.

okay so let me translate that into group-chat: you flip this option on, and every incoming datagram gets a lil bonus control message riding along with it. that message is a struct in6_pktinfo β€” RFC 3542 said so, periodt. ✨

vibe check: this is only allowed on SOCK_DGRAM or SOCK_RAW sockets. other socket types? not invited to the party πŸ™ˆ

πŸ’€ ERRORS πŸ’€

See IPPROTO_IPV6(2const). See setsockopt(2). See ipv6(7).

that's it, that's the section. the error lore lives in those pages, so go read them if something's acting up bestie 😭


⭐ HISTORY ⭐

Linux 2.6.14.

an icon from way back, we love a legacy queen πŸ‘‘


🌸 SEE ALSO 🌸


that's the whole page, no filler, all facts, we ate and left no crumbs πŸ“

mwah πŸ’‹ β€” this was IPV6_RECVPKTINFO from Linux man-pages 6.20, dated 2025-12-02. go set some socket options, main character πŸ’œ

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms