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

# IPV6\_RECVPKTINFO(2const)

set delivery of the IPV6\_PKTINFO control message on incoming datagrams

## NAME

IPV6\_RECVPKTINFO - set delivery of the IPV6\_PKTINFO control message on incoming datagrams

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

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

**int setsockopt(int** *sockfd***, IPPROTO\_IPV6, IPV6\_RECVPKTINFO,**                **const int \****enable***, sizeof(int));**

## DESCRIPTION

Set delivery of the **IPV6\_PKTINFO** control message on incoming datagrams. Such control messages contain a *struct in6\_pktinfo*, as per RFC 3542.

Allowed only for **SOCK\_DGRAM** or **SOCK\_RAW** sockets.

## ERRORS

See [**IPPROTO\_IPV6**(2const)](/IPPROTO_IPV6/2const.md). See [**setsockopt**(2)](/setsockopt/2.md). See [**ipv6**(7)](/ipv6/7.md).

## HISTORY

Linux 2.6.14.

## SEE ALSO

[**IPPROTO\_IPV6**(2const)](/IPPROTO_IPV6/2const.md), [**setsockopt**(2)](/setsockopt/2.md), [**cmsg**(3)](/cmsg/3.md), [**ipv6**(7)](/ipv6/7.md)
