IP_RECVORIGDSTADDR(2const)

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

πŸ’– IP_RECVORIGDSTADDR(2const) πŸ’–

okay bestie, sit down, hydrate, and let me tell you about IP_RECVORIGDSTADDR β€” it's the IP_RECVORIGDSTADDR constant from the IP* family, and it's giving "receive IP_ORIGDSTADDR control message" and nothing less. πŸŽ€


✨ NAME ✨

IP_RECVORIGDSTADDR β€” receive IP_ORIGDSTADDR control message. that's the whole vibe. no cap.


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc). the classic. the icon. the one that's literally always there for you. 🫢


πŸ’… SYNOPSIS πŸ’…

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

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

look at that signature glow up. ✨ (<netinet/in.h> is where the IP* constants live, fyi, that's what the comment is telling you, iykyk.)


🌸 DESCRIPTION 🌸

so here's the tea. πŸ“ this is a boolean option β€” yes/no, on/off, slay/not-slay β€” and when you flip it on, it enables the IP_ORIGDSTADDR ancillary message in recvmsg(2). and what does that message do, you ask? the kernel hands you back the original destination address of the datagram you're receiving. like, "hey girl, here's where this packet was actually headed before somebody redirected it." main character energy for real. πŸ‘‘

the ancillary message contains a sockaddr_in(2type) structure. that's the container. that's what you're catching. πŸŽ€

🚫 real talk bestie, do NOT try this on SOCK_STREAM sockets. it is not supported there. stream sockets said "not today." it's giving undefined disappointment. just don't.

πŸ’€ ERRORS πŸ’€

the error deets live elsewhere, so go check:

three places. that's the reading list. go off. πŸ™ˆ


⭐ STANDARDS ⭐

Linux. that's it. that's the standard. homegrown, iconic, no notes. πŸ‘‘


πŸ¦‹ HISTORY πŸ¦‹

Linux 2.6.29. a vintage. a classic. it's been serving since way back. ✨


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸ’– this came to you from Linux man-pages 6.20, dated 2025-11-25 β€” periodt. go set that socket option and slay responsibly. πŸŽ€βœ¨πŸ’…

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