IPV6_UNICAST_HOPS(2const)

IPV6_UNICAST_HOPS2const

Unicast hop limit

Usage

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

Library

Standard C library (libc, -lc)

Overview

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). See setsockopt(2). See ipv6(7).

History

IPV6_UNICAST_HOPS

POSIX.1-2001.

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