IP_RECVORIGDSTADDR(2const)
π 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:
- see
IPPROTO_IP(2const) - see
setsockopt(2) - see
ip(7)
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