---
name: "IPV6_UNICAST_HOPS"
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_UNICAST_HOPS"
---

# IPV6\_UNICAST\_HOPS(2const)

unicast hop limit

## NAME

IPV6\_UNICAST\_HOPS - unicast hop limit

## 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\_UNICAST\_HOPS,**                **const int \****hops***, sizeof(int));**

## DESCRIPTION

Set the unicast hop limit for the socket.

A value of **-1** means use the route default; otherwise it should be in the range \[**0**, **255**\].

## ERRORS

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

## HISTORY

- **IPV6\_UNICAST\_HOPS**

  POSIX.1-2001.

## SEE ALSO

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