inet6: only mark autoconf addresses tentative if detached
[dragonfly.git] / share / man / man4 / ip6.4
1 .\"     $KAME: ip6.4,v 1.23 2005/01/11 05:56:25 itojun Exp $
2 .\"     $OpenBSD: ip6.4,v 1.21 2005/01/06 03:50:46 itojun Exp $
3 .\"     $FreeBSD: src/share/man/man4/ip6.4,v 1.18 2005/01/23 16:02:48 gnn Exp $
4 .\"
5 .\" Copyright (c) 1983, 1991, 1993
6 .\"     The Regents of the University of California.  All rights reserved.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .Dd December 31, 2019
33 .Dt IP6 4
34 .Os
35 .Sh NAME
36 .Nm ip6
37 .Nd Internet Protocol version 6 (IPv6) network layer
38 .Sh SYNOPSIS
39 .In sys/socket.h
40 .In netinet/in.h
41 .Ft int
42 .Fn socket AF_INET6 SOCK_RAW proto
43 .Sh DESCRIPTION
44 The IPv6 network layer is used by the IPv6 protocol family for
45 transporting data.
46 IPv6 packets contain an IPv6 header that is not provided as part of the
47 payload contents when passed to an application.
48 IPv6 header options affect the behavior of this protocol and may be used
49 by high-level protocols (such as the
50 .Xr tcp 4
51 and
52 .Xr udp 4
53 protocols) as well as directly by
54 .Dq raw sockets ,
55 which process IPv6 messages at a lower-level and may be useful for
56 developing new protocols and special-purpose applications.
57 .Ss Header
58 All IPv6 packets begin with an IPv6 header.
59 When data received by the kernel are passed to the application, this
60 header is not included in buffer, even when raw sockets are being used.
61 Likewise, when data are sent to the kernel for transmit from the
62 application, the buffer is not examined for an IPv6 header:
63 the kernel always constructs the header.
64 To directly access IPv6 headers from received packets and specify them
65 as part of the buffer passed to the kernel, link-level access
66 .Po
67 .Xr bpf 4 ,
68 for example
69 .Pc
70 must instead be utilized.
71 .Pp
72 The header has the following definition:
73 .Bd -literal -offset indent
74 struct ip6_hdr {
75      union {
76           struct ip6_hdrctl {
77                u_int32_t ip6_un1_flow;  /* 20 bits of flow ID */
78                u_int16_t ip6_un1_plen;  /* payload length */
79                u_int8_t  ip6_un1_nxt;   /* next header */
80                u_int8_t  ip6_un1_hlim;  /* hop limit */
81           } ip6_un1;
82           u_int8_t ip6_un2_vfc;   /* version and class */
83      } ip6_ctlun;
84      struct in6_addr ip6_src;   /* source address */
85      struct in6_addr ip6_dst;   /* destination address */
86 } __packed;
87
88 #define ip6_vfc         ip6_ctlun.ip6_un2_vfc
89 #define ip6_flow        ip6_ctlun.ip6_un1.ip6_un1_flow
90 #define ip6_plen        ip6_ctlun.ip6_un1.ip6_un1_plen
91 #define ip6_nxt         ip6_ctlun.ip6_un1.ip6_un1_nxt
92 #define ip6_hlim        ip6_ctlun.ip6_un1.ip6_un1_hlim
93 #define ip6_hops        ip6_ctlun.ip6_un1.ip6_un1_hlim
94 .Ed
95 .Pp
96 All fields are in network-byte order.
97 Any options specified (see
98 .Sx Options
99 below) must also be specified in network-byte order.
100 .Pp
101 .Va ip6_flow
102 specifies the flow ID.
103 .Va ip6_plen
104 specifies the payload length.
105 .Va ip6_nxt
106 specifies the type of the next header.
107 .Va ip6_hlim
108 specifies the hop limit.
109 .Pp
110 The top 4 bits of
111 .Va ip6_vfc
112 specify the class and the bottom 4 bits specify the version.
113 .Pp
114 .Va ip6_src
115 and
116 .Va ip6_dst
117 specify the source and destination addresses.
118 .Pp
119 The IPv6 header may be followed by any number of extension headers that start
120 with the following generic definition:
121 .Bd -literal -offset indent
122 struct ip6_ext {
123      u_int8_t ip6e_nxt;
124      u_int8_t ip6e_len;
125 } __packed;
126 .Ed
127 .Ss Options
128 IPv6 allows header options on packets to manipulate the behavior of the
129 protocol.
130 These options and other control requests are accessed with the
131 .Xr getsockopt 2
132 and
133 .Xr setsockopt 2
134 system calls at level
135 .Dv IPPROTO_IPV6
136 and by using ancillary data in
137 .Xr recvmsg 2
138 and
139 .Xr sendmsg 2 .
140 They can be used to access most of the fields in the IPv6 header and
141 extension headers.
142 .Pp
143 The following socket options are supported:
144 .Bl -tag -width Ds
145 .\" .It Dv IPV6_OPTIONS
146 .It Dv IPV6_UNICAST_HOPS Fa "int *"
147 Get or set the default hop limit header field for outgoing unicast
148 datagrams sent on this socket.
149 A value of \-1 resets to the default value.
150 .\" .It Dv IPV6_RECVOPTS Fa "int *"
151 .\" Get or set the status of whether all header options will be
152 .\" delivered along with the datagram when it is received.
153 .\" .It Dv IPV6_RECVRETOPTS Fa "int *"
154 .\" Get or set the status of whether header options will be delivered
155 .\" for reply.
156 .\" .It Dv IPV6_RECVDSTADDR Fa "int *"
157 .\" Get or set the status of whether datagrams are received with
158 .\" destination addresses.
159 .\" .It Dv IPV6_RETOPTS
160 .\" Get or set IPv6 options.
161 .It Dv IPV6_MULTICAST_IF Fa "u_int *"
162 Get or set the interface from which multicast packets will be sent.
163 For hosts with multiple interfaces, each multicast transmission is sent
164 from the primary network interface.
165 The interface is specified as its index as provided by
166 .Xr if_nametoindex 3 .
167 A value of zero specifies the default interface.
168 .It Dv IPV6_MULTICAST_HOPS Fa "int *"
169 Get or set the default hop limit header field for outgoing multicast
170 datagrams sent on this socket.
171 This option controls the scope of multicast datagram transmissions.
172 .Pp
173 Datagrams with a hop limit of 1 are not forwarded beyond the local
174 network.
175 Multicast datagrams with a hop limit of zero will not be transmitted on
176 any network but may be delivered locally if the sending host belongs to
177 the destination group and if multicast loopback (see below) has not been
178 disabled on the sending socket.
179 Multicast datagrams with a hop limit greater than 1 may be forwarded to
180 the other networks if a multicast router (such as
181 .Xr mrouted 8 Pq Pa net/mrouted )
182 is attached to the local network.
183 .It Dv IPV6_MULTICAST_LOOP Fa "u_int *"
184 Get or set the status of whether multicast datagrams will be looped back
185 for local delivery when a multicast datagram is sent to a group to which
186 the sending host belongs.
187 .Pp
188 This option improves performance for applications that may have no more
189 than one instance on a single host (such as a router daemon) by
190 eliminating the overhead of receiving their own transmissions.
191 It should generally not be used by applications for which there may be
192 more than one instance on a single host (such as a conferencing program)
193 or for which the sender does not belong to the destination group
194 (such as a time-querying program).
195 .Pp
196 A multicast datagram sent with an initial hop limit greater than 1 may
197 be delivered to the sending host on a different interface from that on
198 which it was sent if the host belongs to the destination group on that
199 other interface.
200 The multicast loopback control option has no effect on such delivery.
201 .It Dv IPV6_JOIN_GROUP Fa "struct ipv6_mreq *"
202 Join a multicast group.
203 A host must become a member of a multicast group before it can receive
204 datagrams sent to the group.
205 .Bd -literal
206 struct ipv6_mreq {
207         struct in6_addr ipv6mr_multiaddr;
208         unsigned int    ipv6mr_interface;
209 };
210 .Ed
211 .Pp
212 .Va ipv6mr_interface
213 may be set to zeroes to choose the default multicast interface or to the
214 index of a particular multicast-capable interface if the host is
215 multihomed.
216 Membership is associated with a single interface; programs running on
217 multihomed hosts may need to join the same group on more than one
218 interface.
219 .Pp
220 If the multicast address is unspecified (i.e., all zeroes), messages
221 from all multicast addresses will be accepted by this group.
222 Note that setting to this value requires superuser privileges.
223 .It Dv IPV6_LEAVE_GROUP Fa "struct ipv6_mreq *"
224 Drop membership from the associated multicast group.
225 Memberships are automatically dropped when the socket is closed or when
226 the process exits.
227 .It Dv IPV6_PORTRANGE Fa "int *"
228 Get or set the allocation policy of ephemeral ports for when the kernel
229 automatically binds a local address to this socket.
230 The following values are available:
231 .Pp
232 .Bl -tag -width IPV6_PORTRANGE_DEFAULT -compact
233 .It Dv IPV6_PORTRANGE_DEFAULT
234 Use the regular range of non-reserved ports (varies, see
235 .Xr sysctl 8 ) .
236 .It Dv IPV6_PORTRANGE_HIGH
237 Use a high range (varies, see
238 .Xr sysctl 8 ) .
239 .It Dv IPV6_PORTRANGE_LOW
240 Use a low, reserved range (600\-1023).
241 .El
242 .It Dv IPV6_PKTINFO Fa "int *"
243 Get or set whether additional information about subsequent packets will
244 be provided as ancillary data along with the payload in subsequent
245 .Xr recvmsg 2
246 calls.
247 The information is stored in the following structure in the ancillary
248 data returned:
249 .Bd -literal
250 struct in6_pktinfo {
251         struct in6_addr ipi6_addr;    /* src/dst IPv6 address */
252         unsigned int    ipi6_ifindex; /* send/recv if index */
253 };
254 .Ed
255 .It Dv IPV6_HOPLIMIT Fa "int *"
256 Get or set whether the hop limit header field from subsequent packets
257 will be provided as ancillary data along with the payload in subsequent
258 .Xr recvmsg 2
259 calls.
260 The value is stored as an
261 .Vt int
262 in the ancillary data returned.
263 .\" .It Dv IPV6_NEXTHOP Fa "int *"
264 .\" Get or set whether the address of the next hop for subsequent
265 .\" packets will be provided as ancillary data along with the payload in
266 .\" subsequent
267 .\" .Xr recvmsg 2
268 .\" calls.
269 .\" The option is stored as a
270 .\" .Vt sockaddr
271 .\" structure in the ancillary data returned.
272 .\" .Pp
273 .\" This option requires superuser privileges.
274 .It Dv IPV6_HOPOPTS Fa "int *"
275 Get or set whether the hop-by-hop options from subsequent packets will be
276 provided as ancillary data along with the payload in subsequent
277 .Xr recvmsg 2
278 calls.
279 The option is stored in the following structure in the ancillary data
280 returned:
281 .Bd -literal
282 struct ip6_hbh {
283         u_int8_t ip6h_nxt;      /* next header */
284         u_int8_t ip6h_len;      /* length in units of 8 octets */
285 /* followed by options */
286 } __packed;
287 .Ed
288 .Pp
289 The
290 .Fn inet6_option_space
291 routine and family of routines may be used to manipulate this data.
292 .Pp
293 This option requires superuser privileges.
294 .It Dv IPV6_DSTOPTS Fa "int *"
295 Get or set whether the destination options from subsequent packets will
296 be provided as ancillary data along with the payload in subsequent
297 .Xr recvmsg 2
298 calls.
299 The option is stored in the following structure in the ancillary data
300 returned:
301 .Bd -literal
302 struct ip6_dest {
303         u_int8_t ip6d_nxt;      /* next header */
304         u_int8_t ip6d_len;      /* length in units of 8 octets */
305 /* followed by options */
306 } __packed;
307 .Ed
308 .Pp
309 The
310 .Fn inet6_option_space
311 routine and family of routines may be used to manipulate this data.
312 .Pp
313 This option requires superuser privileges.
314 .It Dv IPV6_RTHDR Fa "int *"
315 Get or set whether the routing header from subsequent packets will be
316 provided as ancillary data along with the payload in subsequent
317 .Xr recvmsg 2
318 calls.
319 The header is stored in the following structure in the ancillary data
320 returned:
321 .Bd -literal
322 struct ip6_rthdr {
323         u_int8_t ip6r_nxt;      /* next header */
324         u_int8_t ip6r_len;      /* length in units of 8 octets */
325         u_int8_t ip6r_type;     /* routing type */
326         u_int8_t ip6r_segleft;  /* segments left */
327 /* followed by routing-type-specific data */
328 } __packed;
329 .Ed
330 .Pp
331 The
332 .Fn inet6_option_space
333 routine and family of routines may be used to manipulate this data.
334 .Pp
335 This option requires superuser privileges.
336 .It Dv IPV6_PKTOPTIONS Fa "struct cmsghdr *"
337 Get or set all header options and extension headers at one time on the
338 last packet sent or received on the socket.
339 All options must fit within the size of an mbuf (see
340 .Xr mbuf 9 ) .
341 Options are specified as a series of
342 .Vt cmsghdr
343 structures followed by corresponding values.
344 .Va cmsg_level
345 is set to
346 .Dv IPPROTO_IPV6 ,
347 .Va cmsg_type
348 to one of the other values in this list, and trailing data to the option
349 value.
350 When setting options, if the length
351 .Va optlen
352 to
353 .Xr setsockopt 2
354 is zero, all header options will be reset to their default values.
355 Otherwise, the length should specify the size the series of control
356 messages consumes.
357 .Pp
358 Instead of using
359 .Xr sendmsg 2
360 to specify option values, the ancillary data used in these calls that
361 correspond to the desired header options may be directly specified as
362 the control message in the series of control messages provided as the
363 argument to
364 .Xr setsockopt 2 .
365 .It Dv IPV6_CHECKSUM Fa "int *"
366 Get or set the byte offset into a packet where the 16-bit checksum is
367 located.
368 When set, this byte offset is where incoming packets will be expected
369 to have checksums of their data stored and where outgoing packets will
370 have checksums of their data computed and stored by the kernel.
371 A value of \-1 specifies that no checksums will be checked on incoming
372 packets and that no checksums will be computed or stored on outgoing
373 packets.
374 The offset of the checksum for ICMPv6 sockets cannot be relocated or
375 turned off.
376 .It Dv IPV6_V6ONLY Fa "int *"
377 Setting this option disallows ipv6<->ipv4 mappings.  Clearing this
378 option allows such mappings.  However,
379 .Dx
380 no longer implements ipv6<->ipv4 mappings.  The value set by this option
381 will be ignored and the socketopt will succeed in both cases.
382 .Xr getsockopt 2
383 for this option will always return a value of 1, indicating that ipv6
384 sockets only operate with ipv6 and will not map ipv4.
385 .It Dv IPV6_USE_MIN_MTU Fa "int *"
386 Get or set whether the minimal IPv6 maximum transmission unit (MTU) size
387 will be used to avoid fragmentation from occurring for subsequent
388 outgoing datagrams.
389 .El
390 .Pp
391 The
392 .Dv IPV6_PKTINFO ,
393 .\" .Dv IPV6_NEXTHOP ,
394 .Dv IPV6_HOPLIMIT ,
395 .Dv IPV6_HOPOPTS ,
396 .Dv IPV6_DSTOPTS ,
397 and
398 .Dv IPV6_RTHDR
399 options will return ancillary data along with payload contents in subsequent
400 .Xr recvmsg 2
401 calls with
402 .Va cmsg_level
403 set to
404 .Dv IPPROTO_IPV6
405 and
406 .Va cmsg_type
407 set to respective option name value (e.g.,
408 .Dv IPV6_HOPLIMIT ) .
409 These options may also be used directly as ancillary
410 .Va cmsg_type
411 values in
412 .Xr sendmsg 2
413 to set options on the packet being transmitted by the call.
414 The
415 .Va cmsg_level
416 value must be
417 .Dv IPPROTO_IPV6 .
418 For these options, the ancillary data object value format is the same
419 as the value returned as explained for each when received with
420 .Xr recvmsg 2 .
421 .Pp
422 Note that using
423 .Xr sendmsg 2
424 to specify options on particular packets works only on UDP and raw sockets.
425 To manipulate header options for packets on TCP sockets, only the socket
426 options may be used.
427 .Pp
428 In some cases, there are multiple APIs defined for manipulating an IPv6
429 header field.
430 A good example is the outgoing interface for multicast datagrams, which
431 can be set by the
432 .Dv IPV6_MULTICAST_IF
433 socket option, through the
434 .Dv IPV6_PKTINFO
435 option, and through the
436 .Va sin6_scope_id
437 field of the socket address passed to the
438 .Xr sendto 2
439 system call.
440 .Pp
441 Resolving these conflicts is implementation dependent.
442 This implementation determines the value in the following way:
443 options specified by using ancillary data (i.e.,
444 .Xr sendmsg 2 )
445 are considered first,
446 options specified by using
447 .Dv IPV6_PKTOPTIONS
448 to set
449 .Dq sticky
450 options are considered second,
451 options specified by using the individual, basic, and direct socket
452 options (e.g.,
453 .Dv IPV6_UNICAST_HOPS )
454 are considered third,
455 and options specified in the socket address supplied to
456 .Xr sendto 2
457 are the last choice.
458 .Ss Multicasting
459 IPv6 multicasting is supported only on
460 .Dv AF_INET6
461 sockets of type
462 .Dv SOCK_DGRAM
463 and
464 .Dv SOCK_RAW ,
465 and only on networks where the interface driver supports
466 multicasting.
467 Socket options (see above) that manipulate membership of
468 multicast groups and other multicast options include
469 .Dv IPV6_MULTICAST_IF ,
470 .Dv IPV6_MULTICAST_HOPS ,
471 .Dv IPV6_MULTICAST_LOOP ,
472 .Dv IPV6_LEAVE_GROUP ,
473 and
474 .Dv IPV6_JOIN_GROUP .
475 .Ss Raw Sockets
476 Raw IPv6 sockets are connectionless and are normally used with the
477 .Xr sendto 2
478 and
479 .Xr recvfrom 2
480 calls, although the
481 .Xr connect 2
482 call may be used to fix the destination address for future outgoing
483 packets so that
484 .Xr send 2
485 may instead be used and the
486 .Xr bind 2
487 call may be used to fix the source address for future outgoing
488 packets instead of having the kernel choose a source address.
489 .Pp
490 By using
491 .Xr connect 2
492 or
493 .Xr bind 2 ,
494 raw socket input is constrained to only packets with their
495 source address matching the socket destination address if
496 .Xr connect 2
497 was used and to packets with their destination address
498 matching the socket source address if
499 .Xr bind 2
500 was used.
501 .Pp
502 If the
503 .Ar proto
504 argument to
505 .Xr socket 2
506 is zero, the default protocol
507 .Pq Dv IPPROTO_RAW
508 is used for outgoing packets.
509 For incoming packets, protocols recognized by kernel are
510 .Sy not
511 passed to the application socket (e.g.,
512 .Xr tcp 4
513 and
514 .Xr udp 4 )
515 except for some ICMPv6 messages.
516 The ICMPv6 messages not passed to raw sockets include echo, timestamp,
517 and address mask requests.
518 If
519 .Ar proto
520 is non-zero, only packets with this protocol will be passed to the
521 socket.
522 .Pp
523 IPv6 fragments are also not passed to application sockets until
524 they have been reassembled.
525 If reception of all packets is desired, link-level access (such as
526 .Xr bpf 4 )
527 must be used instead.
528 .Pp
529 Outgoing packets automatically have an IPv6 header prepended to them
530 (based on the destination address and the protocol number the socket
531 was created with).
532 Incoming packets are received by an application without the IPv6 header
533 or any extension headers.
534 .Pp
535 Outgoing packets will be fragmented automatically by the kernel if they
536 are too large.
537 Incoming packets will be reassembled before being sent to the raw socket,
538 so packet fragments or fragment headers will never be seen on a raw socket.
539 .Sh EXAMPLES
540 The following determines the hop limit on the next packet received:
541 .Bd -literal
542 struct iovec iov[2];
543 u_char buf[BUFSIZ];
544 struct cmsghdr *cm;
545 struct msghdr m;
546 int found, optval;
547 u_char data[2048];
548
549 /* Create socket. */
550
551 (void)memset(&m, 0, sizeof(m));
552 (void)memset(&iov, 0, sizeof(iov));
553
554 iov[0].iov_base = data;         /* buffer for packet payload */
555 iov[0].iov_len = sizeof(data);  /* expected packet length */
556
557 m.msg_name = &from;             /* sockaddr_in6 of peer */
558 m.msg_namelen = sizeof(from);
559 m.msg_iov = iov;
560 m.msg_iovlen = 1;
561 m.msg_control = (caddr_t)buf;   /* buffer for control messages */
562 m.msg_controllen = sizeof(buf);
563
564 /*
565  * Enable the hop limit value from received packets to be
566  * returned along with the payload.
567  */
568 optval = 1;
569 if (setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &optval,
570     sizeof(optval)) == -1)
571         err(1, "setsockopt");
572
573 found = 0;
574 while (!found) {
575         if (recvmsg(s, &m, 0) == -1)
576                 err(1, "recvmsg");
577         for (cm = CMSG_FIRSTHDR(&m); cm != NULL;
578              cm = CMSG_NXTHDR(&m, cm)) {
579                 if (cm->cmsg_level == IPPROTO_IPV6 &&
580                     cm->cmsg_type == IPV6_HOPLIMIT &&
581                     cm->cmsg_len == CMSG_LEN(sizeof(int))) {
582                         found = 1;
583                         (void)printf("hop limit: %d\en",
584                             *(int *)CMSG_DATA(cm));
585                         break;
586                 }
587         }
588 }
589 .Ed
590 .Sh DIAGNOSTICS
591 A socket operation may fail with one of the following errors returned:
592 .Bl -tag -width EADDRNOTAVAILxx
593 .It Bq Er EISCONN
594 when trying to establish a connection on a socket which
595 already has one or when trying to send a datagram with the destination
596 address specified and the socket is already connected.
597 .It Bq Er ENOTCONN
598 when trying to send a datagram, but
599 no destination address is specified, and the socket hasn't been
600 connected.
601 .It Bq Er ENOBUFS
602 when the system runs out of memory for
603 an internal data structure.
604 .It Bq Er EADDRNOTAVAIL
605 when an attempt is made to create a
606 socket with a network address for which no network interface
607 exists.
608 .It Bq Er EACCES
609 when an attempt is made to create
610 a raw IPv6 socket by a non-privileged process.
611 .El
612 .Pp
613 The following errors specific to IPv6 may occur when setting or getting
614 header options:
615 .Bl -tag -width EADDRNOTAVAILxx
616 .It Bq Er EINVAL
617 An unknown socket option name was given.
618 .It Bq Er EINVAL
619 An ancillary data object was improperly formed.
620 .El
621 .Sh SEE ALSO
622 .Xr getsockopt 2 ,
623 .Xr recv 2 ,
624 .Xr send 2 ,
625 .Xr setsockopt 2 ,
626 .Xr socket 2 ,
627 .\" .Xr inet6_option_space 3 ,
628 .\" .Xr inet6_rthdr_space 3 ,
629 .Xr if_nametoindex 3 ,
630 .Xr bpf 4 ,
631 .Xr icmp6 4 ,
632 .Xr inet6 4 ,
633 .Xr netintro 4 ,
634 .Xr tcp 4 ,
635 .Xr udp 4
636 .Rs
637 .%A W. Stevens
638 .%A M. Thomas
639 .%T Advanced Sockets API for IPv6
640 .%R RFC 2292
641 .%D February 1998
642 .Re
643 .Rs
644 .%A S. Deering
645 .%A R. Hinden
646 .%T Internet Protocol, Version 6 (IPv6) Specification
647 .%R RFC 2460
648 .%D December 1998
649 .Re
650 .Rs
651 .%A R. Gilligan
652 .%A S. Thomson
653 .%A J. Bound
654 .%A W. Stevens
655 .%T Basic Socket Interface Extensions for IPv6
656 .%R RFC 2553
657 .%D March 1999
658 .Re
659 .Rs
660 .%A W. Stevens
661 .%A B. Fenner
662 .%A A. Rudoff
663 .%T UNIX Network Programming, third edition
664 .Re
665 .Sh STANDARDS
666 Most of the socket options are defined in RFC 2292 or RFC 2553.
667 The
668 .Dv IPV6_V6ONLY
669 socket option is defined in RFC 3542.
670 The
671 .Dv IPV6_PORTRANGE
672 socket option and the conflict resolution rule are not defined in the
673 RFCs and should be considered implementation dependent.