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