IP_RETOPTS(2const)

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

✨ IP_RETOPTS ✨

okay so bestie, welcome to IP_RETOPTS(2const) β€” yes it's a section 2 const page, iykyk πŸ’…

🌸 NAME 🌸

IP_RETOPTS β€” receive most incoming IP options in 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_IP, IP_RETOPTS,
               const int *enabled, sizeof(int));

πŸ’– DESCRIPTION πŸ’–

So this one is literally identical to IP_RECVOPTS(2const) β€” like, same energy, same behaviour β€” except it hands you back the raw, unprocessed options instead of the cooked version. And by raw i mean: the timestamp and route record options are not filled in for this hop. not filled in, periodt. 🫣

important bestie: this is not supported for SOCK_STREAM sockets πŸ’€ don't try it, it's giving undefined behaviour.

😭 ERRORS 😭

for the error tea, go check IPPROTO_IP(2const). also check setsockopt(2). also check ip(7). that's the trio, no cap πŸ“–βœ¨


πŸ‘‘ HISTORY πŸ‘‘

Linux 2.2 β€” yeah she's a vintage icon, been here since the olden days πŸ•°οΈπŸ’œ


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole vibe, bestie β€” go forth and read your IP options raw, main character energy only πŸ‘‘πŸŒˆ

with love, from the Linux man-pages 6.20 girlies, dated 2025-11-25 πŸŽ€πŸ’–

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