---
name: "IP_RECVORIGDSTADDR"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/IP_RECVORIGDSTADDR"
---

# IP\_RECVORIGDSTADDR(2const)

receive IP\_ORIGDSTADDR control message

## NAME

IP\_RECVORIGDSTADDR - receive IP\_ORIGDSTADDR 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\_RECVORIGDSTADDR,**                **const int \****enable***, sizeof(int));**

## DESCRIPTION

This boolean option enables the **IP\_ORIGDSTADDR** ancillary message in [**recvmsg**(2)](/recvmsg/2.md), 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)](/IPPROTO_IP/2const.md). See [**setsockopt**(2)](/setsockopt/2.md). See [**ip**(7)](/ip/7.md).

## STANDARDS

Linux.

## HISTORY

Linux 2.6.29.

## SEE ALSO

[**IPPROTO\_IP**(2const)](/IPPROTO_IP/2const.md), [**setsockopt**(2)](/setsockopt/2.md), [**ip**(7)](/ip/7.md)
