| 1 |
.\" Copyright, the authors of the Linux man-pages project |
| 2 |
.\" |
| 3 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 4 |
.\" |
| 5 |
.TH IPV6_UNICAST_HOPS 2const 2026-01-05 "Linux man-pages 6.18" |
| 6 |
.SH NAME |
| 7 |
IPV6_UNICAST_HOPS |
| 8 |
\- |
| 9 |
unicast hop limit |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.BR "#include <netinet/in.h>" " /* Definition of " IP* " constants */" |
| 16 |
.B #include <sys/socket.h> |
| 17 |
.P |
| 18 |
.BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IPV6,\~IPV6_UNICAST_HOPS, |
| 19 |
.BI " const\~int\~*" hops ,\~sizeof(int)); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
Set the unicast hop limit for the socket. |
| 23 |
.P |
| 24 |
A value of |
| 25 |
.B \-1 |
| 26 |
means use the route default; |
| 27 |
otherwise it should be in the range |
| 28 |
.RB [ 0 , |
| 29 |
.BR 255 ]. |
| 30 |
.SH ERRORS |
| 31 |
See |
| 32 |
.BR IPPROTO_IPV6 (2const). |
| 33 |
See |
| 34 |
.BR setsockopt (2). |
| 35 |
See |
| 36 |
.BR ipv6 (7). |
| 37 |
.SH HISTORY |
| 38 |
.TP |
| 39 |
.B IPV6_UNICAST_HOPS |
| 40 |
POSIX.1-2001. |
| 41 |
.SH SEE ALSO |
| 42 |
.BR IPPROTO_IPV6 (2const), |
| 43 |
.BR setsockopt (2), |
| 44 |
.BR ipv6 (7) |