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