| 1 |
.\" Copyright, the authors of the Linux man-pages project |
| 2 |
.\" |
| 3 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 4 |
.\" |
| 5 |
.\" The following socket options are undocumented |
| 6 |
.\" All of the following are from: |
| 7 |
.\" commit 333fad5364d6b457c8d837f7d05802d2aaf8a961 |
| 8 |
.\" Author: YOSHIFUJI Hideaki <[email protected]> |
| 9 |
.\" Support several new sockopt / ancillary data in Advanced API (RFC3542). |
| 10 |
.\" IPV6_2292PKTINFO (2.6.14) |
| 11 |
.\" Formerly IPV6_PKTINFO |
| 12 |
.\" IPV6_2292HOPOPTS (2.6.14) |
| 13 |
.\" Formerly IPV6_HOPOPTS, which is documented |
| 14 |
.\" IPV6_2292DSTOPTS (2.6.14) |
| 15 |
.\" Formerly IPV6_DSTOPTS, which is documented |
| 16 |
.\" IPV6_2292RTHDR (2.6.14) |
| 17 |
.\" Formerly IPV6_RTHDR, which is documented |
| 18 |
.\" IPV6_2292PKTOPTIONS (2.6.14) |
| 19 |
.\" Formerly IPV6_PKTOPTIONS |
| 20 |
.\" IPV6_2292HOPLIMIT (2.6.14) |
| 21 |
.\" Formerly IPV6_HOPLIMIT, which is documented |
| 22 |
.\" |
| 23 |
.\" IPV6_RECVHOPLIMIT (2.6.14) |
| 24 |
.\" IPV6_RECVHOPOPTS (2.6.14) |
| 25 |
.\" IPV6_RTHDRDSTOPTS (2.6.14) |
| 26 |
.\" IPV6_RECVRTHDR (2.6.14) |
| 27 |
.\" IPV6_RECVDSTOPTS (2.6.14) |
| 28 |
.\" |
| 29 |
.\" IPV6_RECVPATHMTU (Linux 2.6.35, flag value added in Linux 2.6.14) |
| 30 |
.\" commit 793b14731686595a741d9f47726ad8b9a235385a |
| 31 |
.\" Author: Brian Haley <[email protected]> |
| 32 |
.\" IPV6_PATHMTU (Linux 2.6.35, flag value added in Linux 2.6.14) |
| 33 |
.\" commit 793b14731686595a741d9f47726ad8b9a235385a |
| 34 |
.\" Author: Brian Haley <[email protected]> |
| 35 |
.\" IPV6_DONTFRAG (Linux 2.6.35, flag value added in Linux 2.6.14) |
| 36 |
.\" commit 793b14731686595a741d9f47726ad8b9a235385a |
| 37 |
.\" Author: Brian Haley <[email protected]> |
| 38 |
.\" commit 4b340ae20d0e2366792abe70f46629e576adaf5e |
| 39 |
.\" Author: Brian Haley <[email protected]> |
| 40 |
.\" |
| 41 |
.\" IPV6_RECVTCLASS (Linux 2.6.14) |
| 42 |
.\" commit 41a1f8ea4fbfcdc4232f023732584aae2220de31 |
| 43 |
.\" Author: YOSHIFUJI Hideaki <[email protected]> |
| 44 |
.\" Based on patch from David L Stevens <[email protected]> |
| 45 |
.\" |
| 46 |
.\" IPV6_CHECKSUM (Linux 2.2) |
| 47 |
.\" IPV6_NEXTHOP (Linux 2.2) |
| 48 |
.\" IPV6_JOIN_ANYCAST (Linux 2.4.21 / Linux 2.6) |
| 49 |
.\" IPV6_LEAVE_ANYCAST (Linux 2.4.21 / Linux 2.6) |
| 50 |
.\" IPV6_FLOWLABEL_MGR (Linux 2.2.7 / Linux 2.4) |
| 51 |
.\" IPV6_FLOWINFO_SEND (Linux 2.2.7 / Linux 2.4) |
| 52 |
.\" IPV6_IPSEC_POLICY (Linux 2.6) |
| 53 |
.\" IPV6_XFRM_POLICY (Linux 2.6) |
| 54 |
.\" IPV6_TCLASS (Linux 2.6) |
| 55 |
.\" |
| 56 |
.\" IPV6_ADDR_PREFERENCES (Linux 2.6.26) |
| 57 |
.\" commit 7cbca67c073263c179f605bdbbdc565ab29d801d |
| 58 |
.\" Author: YOSHIFUJI Hideaki <[email protected]> |
| 59 |
.\" IPV6_MINHOPCOUNT (Linux 2.6.35) |
| 60 |
.\" commit e802af9cabb011f09b9c19a82faef3dd315f27eb |
| 61 |
.\" Author: Stephen Hemminger <[email protected]> |
| 62 |
.\" IPV6_ORIGDSTADDR (Linux 2.6.37) |
| 63 |
.\" Actually a CMSG rather than a sockopt? |
| 64 |
.\" In header file, we have IPV6_RECVORIGDSTADDR == IPV6_ORIGDSTADDR |
| 65 |
.\" commit 6c46862280c5f55eda7750391bc65cd7e08c7535 |
| 66 |
.\" Author: Balazs Scheidler <[email protected]> |
| 67 |
.\" IPV6_RECVORIGDSTADDR (Linux 2.6.37) |
| 68 |
.\" commit 6c46862280c5f55eda7750391bc65cd7e08c7535 |
| 69 |
.\" Author: Balazs Scheidler <[email protected]> |
| 70 |
.\" Support for IPV6_RECVORIGDSTADDR sockopt for UDP sockets |
| 71 |
.\" were contributed by Harry Mason. |
| 72 |
.\" IPV6_TRANSPARENT (Linux 2.6.37) |
| 73 |
.\" commit 6c46862280c5f55eda7750391bc65cd7e08c7535 |
| 74 |
.\" Author: Balazs Scheidler <[email protected]> |
| 75 |
.\" IPV6_UNICAST_IF (Linux 3.4) |
| 76 |
.\" commit c4062dfc425e94290ac427a98d6b4721dd2bc91f |
| 77 |
.\" Author: Erich E. Hoover <[email protected]> |
| 78 |
.\" |
| 79 |
.TH IPPROTO_IPV6 2const 2026-01-05 "Linux man-pages 6.18" |
| 80 |
.SH NAME |
| 81 |
IPPROTO_IPV6 |
| 82 |
\- |
| 83 |
Linux IPv6 protocol socket options |
| 84 |
.SH LIBRARY |
| 85 |
Standard C library |
| 86 |
.RI ( libc ,\~ \-lc ) |
| 87 |
.SH SYNOPSIS |
| 88 |
.nf |
| 89 |
.BR "#include <netinet/in.h>" " /* Definition of " IP* " constants */" |
| 90 |
.B #include <sys/socket.h> |
| 91 |
.P |
| 92 |
.BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IPV6,\~int\~ opt , |
| 93 |
.BI " const\~void\~" val [ size ],\~size_t\~ size ); |
| 94 |
.BI int\~getsockopt(int\~ sockfd ,\~IPPROTO_IPV6,\~int\~ opt , |
| 95 |
.BI " void\~" val [ size ],\~size_t\~ size ); |
| 96 |
.fi |
| 97 |
.SH DESCRIPTION |
| 98 |
IPv6 supports some protocol-specific socket options that can be set with |
| 99 |
.BR setsockopt (2) |
| 100 |
and read with |
| 101 |
.BR getsockopt (2). |
| 102 |
The socket option level for IPv6 is |
| 103 |
.BR IPPROTO_IPV6 . |
| 104 |
A boolean integer flag is zero when it is false, otherwise true. |
| 105 |
.P |
| 106 |
The following socket options are supported. |
| 107 |
.TP |
| 108 |
.BR IPV6_ADDRFORM (2const) |
| 109 |
.TQ |
| 110 |
.BR IPV6_ADD_MEMBERSHIP (2const) |
| 111 |
.TQ |
| 112 |
.BR IPV6_DROP_MEMBERSHIP (2const) |
| 113 |
.TQ |
| 114 |
.BR IPV6_MTU (2const) |
| 115 |
.TQ |
| 116 |
.BR IPV6_MTU_DISCOVER (2const) |
| 117 |
.TQ |
| 118 |
.BR IPV6_MULTICAST_HOPS (2const) |
| 119 |
.TQ |
| 120 |
.BR IPV6_MULTICAST_IF (2const) |
| 121 |
.TQ |
| 122 |
.BR IPV6_MULTICAST_LOOP (2const) |
| 123 |
.TQ |
| 124 |
.BR IPV6_RECVPKTINFO (2const) |
| 125 |
.TQ |
| 126 |
.BR IPV6_RTHDR (2const) |
| 127 |
.TQ |
| 128 |
.BR IPV6_AUTHHDR (2const) |
| 129 |
.TQ |
| 130 |
.BR IPV6_DSTOPTS (2const) |
| 131 |
.TQ |
| 132 |
.BR IPV6_HOPOPTS (2const) |
| 133 |
.TQ |
| 134 |
.BR IPV6_FLOWINFO (2const) |
| 135 |
.TQ |
| 136 |
.BR IPV6_HOPLIMIT (2const) |
| 137 |
.TQ |
| 138 |
.BR IPV6_RECVERR (2const) |
| 139 |
.TQ |
| 140 |
.BR IPV6_ROUTER_ALERT (2const) |
| 141 |
.TQ |
| 142 |
.BR IPV6_UNICAST_HOPS (2const) |
| 143 |
.TQ |
| 144 |
.BR IPV6_V6ONLY (2const) |
| 145 |
.SH ERRORS |
| 146 |
See |
| 147 |
.BR setsockopt (2). |
| 148 |
See |
| 149 |
.BR ipv6 (7). |
| 150 |
.TP |
| 151 |
.B ENOPROTOOPT |
| 152 |
.I opt |
| 153 |
is invalid. |
| 154 |
.SH HISTORY |
| 155 |
.TP |
| 156 |
.B IPPROTO_IPV6 |
| 157 |
POSIX.1-2001. |
| 158 |
.SH SEE ALSO |
| 159 |
.BR setsockopt (2), |
| 160 |
.BR cmsg (3), |
| 161 |
.BR ipv6 (7) |