IP_RECVTTL(2const)

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

✨ IP_RECVTTL(2const) ✨

okay bestie, so this one lives in the (2const) girlies section of the Linux man-pages, and it's all about flagging β€” literally, it's a socket option constant πŸŽ€


πŸ’« NAME πŸ’«

IP_RECVTTL β€” the flag that says "yes queen, enable that IP_TTL control message" πŸ‘‘


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) β€” the usual girlies, nothing new here, she's standard for a reason 🫢


🌸 SYNOPSIS 🌸

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

int setsockopt(int sockfd, IPPROTO_IP, int opt,
               const int *enable, sizeof(int));

look at that #include <netinet/in.h> up top β€” that's where all the IP* constants live, iykyk πŸ’…


πŸ’– DESCRIPTION πŸ’–

so when this flag is set (yes, set, not unset β€” we're turning things ON around here), the kernel will pass a IP_TTL(2const) control message your way, carrying the time-to-live field of the received packet as a 32 bit integer ✨

bestie warning 🚨 β€” this is not supported for SOCK_STREAM sockets. if you're on a stream socket, she simply will not serve. sorry babe πŸ’€

πŸ¦‹ ERRORS πŸ¦‹

like, go read the OGs:


πŸ”₯ VERSIONS πŸ”₯

okay this is the important plot twist so listen up diva: some BSD sockets implementations also provide an IP_RECVTTL option, BUT over there an ancillary message with type IP_RECVTTL gets passed along with the incoming packet 😭

that is different from the IP_TTL(2const) option used in Linux β€” so if you port code across and it's giving weird vibes, that's why. no cap πŸ’…


πŸ“œ HISTORY πŸ“œ

Linux 2.2 β€” she's vintage, she's iconic, she's been here since 2.2 🌈⭐


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie πŸŽ€ this little icon came straight out of Linux man-pages 6.20, dated 2025-11-25 β€” go slay some sockets with your TTL values, mwah πŸ’–πŸ‘‘πŸ¦‹

πŸ“¦ 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