IP_RECVORIGDSTADDR(2const)

IP_RECVORIGDSTADDR2const

Receive ip_origdstaddr control message

Usage

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

Library

Standard C library (libc, -lc)

Overview

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.

Errors

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

Standards

Linux.

History

Linux 2.6.29.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.