IP_RECVORIGDSTADDR(2const) IP_RECVORIGDSTADDR(2const)

IP_RECVORIGDSTADDR - receive IP_ORIGDSTADDR control message

Standard C library (libc-lc)

#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));

This boolean option enables the IP_ORIGDSTADDR ancillary message in recvmsg(2), in which the kernel returns the original destination address of the datagram being received.

The ancillary message contains a sockaddr_in(2type) structure.

Not supported for SOCK_STREAM sockets.

See IPPROTO_IP(2const). See setsockopt(2). See ip(7).

Linux.

Linux 2.6.29.

IPPROTO_IP(2const), setsockopt(2), ip(7)

2025-11-25 Linux man-pages 6.17