2 .\" Don't change the line above. it tells man that tbl is needed.
3 .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
4 .\" Permission is granted to distribute possibly modified copies
5 .\" of this page provided the header is included verbatim,
6 .\" and in case of nontrivial modification author and date
7 .\" of the modification is added to the header.
8 .\" $Id: ip.7,v 1.19 2000/12/20 18:10:31 ak Exp $
10 .\" FIXME: Document IP_MINTTL, added in Linux 2.6.34
12 .TH IP 7 2011-09-22 "Linux" "Linux Programmer's Manual"
14 ip \- Linux IPv4 protocol implementation
16 .B #include <sys/socket.h>
18 .\" .B #include <net/netinet.h> -- does not exist anymore
19 .\" .B #include <linux/errqueue.h> -- never include <linux/foo.h>
20 .B #include <netinet/in.h>
22 .B #include <netinet/ip.h> \fR/* superset of previous */
24 .IB tcp_socket " = socket(AF_INET, SOCK_STREAM, 0);"
26 .IB udp_socket " = socket(AF_INET, SOCK_DGRAM, 0);"
28 .IB raw_socket " = socket(AF_INET, SOCK_RAW, " protocol ");"
30 Linux implements the Internet Protocol, version 4,
31 described in RFC\ 791 and RFC\ 1122.
33 contains a level 2 multicasting implementation conforming to RFC\ 1112.
34 It also contains an IP router including a packet filter.
35 .\" FIXME has someone verified that 2.1 is really 1812 compliant?
37 The programming interface is BSD-sockets compatible.
38 For more information on sockets, see
41 An IP socket is created by calling the
44 .BI "socket(AF_INET, " socket_type ", " protocol ) \fR.
45 Valid socket types are
57 socket to access the IP protocol directly.
59 is the IP protocol in the IP header to be received or sent.
60 The only valid values for
64 for TCP sockets, and 0 and
69 you may specify a valid IANA IP protocol defined in
70 RFC\ 1700 assigned numbers.
72 .\" FIXME ip current does an autobind in listen, but I'm not sure
73 .\" if that should be documented.
74 When a process wants to receive new incoming packets or connections, it
75 should bind a socket to a local interface address using
77 Only one IP socket may be bound to any given local (address, port) pair.
80 is specified in the bind call, the socket will be bound to
87 are called on an unbound socket, it is automatically bound to a
88 random free port with the local address set to
91 A TCP local socket address that has been bound is unavailable for
92 some time after closing, unless the
95 Care should be taken when using this flag as it makes TCP less reliable.
97 An IP socket address is defined as a combination of an IP interface
98 address and a 16-bit port number.
99 The basic IP protocol does not supply port numbers, they
100 are implemented by higher level protocols like
106 is set to the IP protocol.
111 sa_family_t sin_family; /* address family: AF_INET */
112 in_port_t sin_port; /* port in network byte order */
113 struct in_addr sin_addr; /* internet address */
116 /* Internet address. */
118 uint32_t s_addr; /* address in network byte order */
126 This is required; in Linux 2.2 most networking functions return
128 when this setting is missing.
130 contains the port in network byte order.
131 The port numbers below 1024 are called
132 .IR "privileged ports"
134 .IR "reserved ports" ).
135 Only privileged processes (i.e., those having the
136 .B CAP_NET_BIND_SERVICE
140 Note that the raw IPv4 protocol as such has no concept of a
141 port, they are only implemented by higher protocols like
147 is the IP host address.
152 contains the host interface address in network byte order.
154 should be assigned one of the
161 .BR inet_makeaddr (3)
162 library functions or directly with the name resolver (see
163 .BR gethostbyname (3)).
165 IPv4 addresses are divided into unicast, broadcast
166 and multicast addresses.
167 Unicast addresses specify a single interface of a host,
168 broadcast addresses specify all hosts on a network and multicast
169 addresses address all hosts in a multicast group.
170 Datagrams to broadcast addresses can be only sent or received when the
173 In the current implementation, connection-oriented sockets are only allowed
174 to use unicast addresses.
175 .\" Leave a loophole for XTP @)
177 Note that the address and the port are always stored in
179 In particular, this means that you need to call
181 on the number that is assigned to a port.
182 All address/port manipulation
183 functions in the standard library work in network byte order.
185 There are several special addresses:
188 always refers to the local host via the loopback device;
191 means any address for binding;
194 means any host and has the same effect on bind as
196 for historical reasons.
198 IP supports some protocol-specific socket options that can be set with
202 The socket option level for IP is
204 .\" or SOL_IP on Linux
205 A boolean integer flag is zero when it is false, otherwise true.
207 .BR IP_ADD_MEMBERSHIP " (since Linux 1.2)"
208 Join a multicast group.
216 struct in_addr imr_multiaddr; /* IP multicast group
218 struct in_addr imr_address; /* IP address of local
220 int imr_ifindex; /* interface index */
226 contains the address of the multicast group the application
227 wants to join or leave.
228 It must be a valid multicast address
229 .\" (i.e., within the 224.0.0.0-239.255.255.255 range)
235 is the address of the local interface with which the system
236 should join the multicast group; if it is equal to
238 an appropriate interface is chosen by the system.
240 is the interface index of the interface that should join/leave the
242 group, or 0 to indicate any interface.
246 structure is available only since Linux 2.2.
247 For compatibility, the old
249 structure (present since Linux 1.2) is still supported;
252 only by not including the
259 .BR IP_DROP_MEMBERSHIP " (since Linux 1.2)"
260 Leave a multicast group.
266 .BR IP_ADD_MEMBERSHIP .
268 .BR IP_FREEBIND " (since Linux 2.4)"
269 .\" Precisely: 2.4.0-test10
270 If enabled, this boolean option allows binding to an IP address
271 that is nonlocal or does not (yet) exist.
272 This permits listening on a socket,
273 without requiring the underlying network interface or the
274 specified dynamic IP address to be up at the time that
275 the application is trying to bind to it.
276 This option is the per-socket equivalent of the
279 interface described below.
281 .BR IP_HDRINCL " (since Linux 2.0)"
283 the user supplies an IP header in front of the user data.
289 for more information.
290 When this flag is enabled the values set by
297 .\" FIXME Document IP_IPSEC_POLICY
298 .\" Since Linux 2.5.47
299 .\" Needs CAP_NET_ADMIN
301 .BR IP_MTU " (since Linux 2.2)"
302 .\" Precisely: 2.1.124
303 Retrieve the current known path MTU of the current socket.
304 Only valid when the socket has been connected.
309 .BR IP_MTU_DISCOVER " (since Linux 2.2)"
310 .\" Precisely: 2.1.124
311 Set or receive the Path MTU Discovery setting for a socket.
312 When enabled, Linux will perform Path MTU Discovery
313 as defined in RFC\ 1191 on
320 forces the don't-fragment flag to be set on all outgoing packets.
321 It is the user's responsibility to packetize the data
322 in MTU-sized chunks and to do the retransmits if necessary.
323 The kernel will reject (with
325 datagrams that are bigger than the known path MTU.
327 will fragment a datagram if needed according to the path MTU,
328 or will set the don't-fragment flag otherwise.
330 The system-wide default can be toggled between
334 by writing (respectively, zero and nonzero values) to the
335 .I /proc/sys/net/ipv4/ip_no_pmtu_disc
342 Path MTU discovery value:Meaning
343 IP_PMTUDISC_WANT:Use per-route settings.
344 IP_PMTUDISC_DONT:Never do Path MTU Discovery.
345 IP_PMTUDISC_DO:Always do Path MTU Discovery.
346 IP_PMTUDISC_PROBE:Set DF but ignore Path MTU.
349 When PMTU discovery is enabled, the kernel automatically keeps track of
350 the path MTU per destination host.
351 When it is connected to a specific peer with
353 the currently known path MTU can be retrieved conveniently using the
355 socket option (e.g., after an
358 The path MTU may change over time.
359 For connectionless sockets with many destinations,
360 the new MTU for a given destination can also be accessed using the
363 A new error will be queued for every incoming MTU update.
365 While MTU discovery is in progress, initial packets from datagram sockets
367 Applications using UDP should be aware of this and not
368 take it into account for their packet retransmit strategy.
370 To bootstrap the path MTU discovery process on unconnected sockets, it
371 is possible to start with a big datagram size
372 (up to 64K-headers bytes long) and let it shrink by updates of the path MTU.
373 .\" FIXME this is an ugly hack
375 To get an initial estimate of the
376 path MTU, connect a datagram socket to the destination address using
378 and retrieve the MTU by calling
384 It is possible to implement RFC 4821 MTU probing with
388 sockets by setting a value of
389 .BR IP_PMTUDISC_PROBE
390 (available since Linux 2.6.22).
391 This is also particularly useful for diagnostic tools such as
393 that wish to deliberately send probe packets larger than
394 the observed Path MTU.
396 .BR IP_MULTICAST_IF " (since Linux 1.2)"
397 Set the local device for a multicast socket.
403 .BR IP_ADD_MEMBERSHIP .
405 When an invalid socket option is passed,
409 .BR IP_MULTICAST_LOOP " (since Linux 1.2)"
410 Set or read a boolean integer argument that determines whether
411 sent multicast packets should be looped back to the local sockets.
413 .BR IP_MULTICAST_TTL " (since Linux 1.2)"
414 Set or read the time-to-live value of outgoing multicast packets for this
416 It is very important for multicast packets to set the smallest TTL possible.
417 The default is 1 which means that multicast packets don't leave the local
418 network unless the user program explicitly requests it.
419 Argument is an integer.
421 .BR IP_NODEFRAG " (since Linux 2.6.36)"
422 If enabled (argument is nonzero),
423 the reassembly of outgoing packets is disabled in the netfilter layer.
424 This option is only valid for
427 The argument is an integer.
429 .BR IP_OPTIONS " (since Linux 2.0)"
430 .\" Precisely: 1.3.30
431 Set or get the IP options to be sent with every packet from this socket.
432 The arguments are a pointer to a memory buffer containing the options
433 and the option length.
436 call sets the IP options associated with a socket.
437 The maximum option size for IPv4 is 40 bytes.
438 See RFC\ 791 for the allowed options.
439 When the initial connection request packet for a
441 socket contains IP options, the IP options will be set automatically
442 to the options from the initial packet with routing headers reversed.
443 Incoming packets are not allowed to change options after the connection
445 The processing of all incoming source routing options
446 is disabled by default and can be enabled by using the
447 .I accept_source_route
450 Other options like timestamps are still handled.
451 For datagram sockets, IP options can be only set by the local user.
456 puts the current IP options used for sending into the supplied buffer.
457 .\" FIXME Document IP_PASSSEC
459 .\" Since Linux 2.6.17
460 .\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c
461 .\" Author: Catherine Zhang <cxzhang@watson.ibm.com>
463 .BR IP_PKTINFO " (since Linux 2.2)"
464 .\" Precisely: 2.1.68
467 ancillary message that contains a
469 structure that supplies some information about the incoming packet.
470 This only works for datagram oriented sockets.
471 The argument is a flag that tells the socket whether the
473 message should be passed or not.
474 The message itself can only be sent/retrieved
475 as control message with a packet using
483 unsigned int ipi_ifindex; /* Interface index */
484 struct in_addr ipi_spec_dst; /* Local address */
485 struct in_addr ipi_addr; /* Header Destination
491 .\" FIXME elaborate on that.
493 is the unique index of the interface the packet was received on.
495 is the local address of the packet and
497 is the destination address in the packet header.
503 .\" This field is grossly misnamed
505 is not zero, then it is used as the local source address for the routing
506 table lookup and for setting up IP source route options.
509 is not zero, the primary local address of the interface specified by the
512 for the routing table lookup.
514 .BR IP_RECVERR " (since Linux 2.2)"
515 .\" Precisely: 2.1.15
516 Enable extended reliable error message passing.
517 When enabled on a datagram socket, all
518 generated errors will be queued in a per-socket error queue.
519 When the user receives an error from a socket operation,
520 the errors can be received by calling
527 structure describing the error will be passed in an ancillary message with
532 .\" or SOL_IP on Linux
533 This is useful for reliable error handling on unconnected sockets.
534 The received data portion of the error queue contains the error packet.
538 control message contains a
545 #define SO_EE_ORIGIN_NONE 0
546 #define SO_EE_ORIGIN_LOCAL 1
547 #define SO_EE_ORIGIN_ICMP 2
548 #define SO_EE_ORIGIN_ICMP6 3
550 struct sock_extended_err {
551 uint32_t ee_errno; /* error number */
552 uint8_t ee_origin; /* where the error originated */
553 uint8_t ee_type; /* type */
554 uint8_t ee_code; /* code */
556 uint32_t ee_info; /* additional information */
557 uint32_t ee_data; /* other data */
558 /* More data may follow */
561 struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
568 number of the queued error.
570 is the origin code of where the error originated.
571 The other fields are protocol-specific.
574 returns a pointer to the address of the network object
575 where the error originated from given a pointer to the ancillary message.
576 If this address is not known, the
582 and the other fields of the
588 structure as follows:
592 for errors received as an ICMP packet, or
593 .B SO_EE_ORIGIN_LOCAL
594 for locally generated errors.
595 Unknown values should be ignored.
599 are set from the type and code fields of the ICMP header.
601 contains the discovered MTU for
604 The message also contains the
605 .I sockaddr_in of the node
606 caused the error, which can be accessed with the
615 when the source was unknown.
616 When the error originated from the network, all IP options
617 .RB ( IP_OPTIONS ", " IP_TTL ", "
618 etc.) enabled on the socket and contained in the
619 error packet are passed as control messages.
620 The payload of the packet causing the error is returned as normal payload.
621 .\" FIXME . Is it a good idea to document that? It is a dubious feature.
626 .\" has slightly different semantics. Instead of
627 .\" saving the errors for the next timeout, it passes all incoming
628 .\" errors immediately to the user.
629 .\" This might be useful for very short-lived TCP connections which
630 .\" need fast error handling. Use this option with care:
631 .\" it makes TCP unreliable
632 .\" by not allowing it to recover properly from routing
633 .\" shifts and other normal
634 .\" conditions and breaks the protocol specification.
635 Note that TCP has no error queue;
641 is valid for TCP, but all errors are returned by socket function return or
647 enables passing of all received ICMP errors to the
648 application, otherwise errors are only reported on connected sockets
650 It sets or retrieves an integer boolean flag.
654 .BR IP_RECVOPTS " (since Linux 2.2)"
655 .\" Precisely: 2.1.15
656 Pass all incoming IP options to the user in a
659 The routing header and other options are already filled in
665 .BR IP_RECVORIGDSTADDR " (since Linux 2.6.29)"
666 .\" commit e8b2dfe9b4501ed0047459b2756ba26e5a940a69
667 This boolean option enables the
671 in which the kernel returns the original destination address
672 of the datagram being received.
673 The ancillary message contains a
674 .IR "struct sockaddr_in" .
676 .BR IP_RECVTOS " (since Linux 2.2)"
677 .\" Precisely: 2.1.68
680 ancillary message is passed with incoming packets.
681 It contains a byte which specifies the Type of Service/Precedence
682 field of the packet header.
683 Expects a boolean integer flag.
685 .BR IP_RECVTTL " (since Linux 2.2)"
686 .\" Precisely: 2.1.68
687 When this flag is set, pass a
689 control message with the time to live
690 field of the received packet as a byte.
695 .BR IP_RETOPTS " (since Linux 2.2)"
696 .\" Precisely: 2.1.15
699 but returns raw unprocessed options with timestamp and route record
700 options not filled in for this hop.
702 .BR IP_ROUTER_ALERT " (since Linux 2.2)"
703 .\" Precisely: 2.1.68
704 Pass all to-be forwarded packets with the
705 IP Router Alert option set to this socket.
706 Only valid for raw sockets.
707 This is useful, for instance, for user-space RSVP daemons.
708 The tapped packets are not forwarded by the kernel; it is
709 the user's responsibility to send them out again.
710 Socket binding is ignored,
711 such packets are only filtered by protocol.
712 Expects an integer flag.
714 .BR IP_TOS " (since Linux 1.0)"
715 Set or receive the Type-Of-Service (TOS) field that is sent
716 with every IP packet originating from this socket.
717 It is used to prioritize packets on the network.
719 There are some standard TOS flags defined:
721 to minimize delays for interactive traffic,
723 to optimize throughput,
725 to optimize for reliability,
727 should be used for "filler data" where slow transmission doesn't matter.
728 At most one of these TOS values can be specified.
729 Other bits are invalid and shall be cleared.
732 datagrams first by default,
733 but the exact behavior depends on the configured queueing discipline.
734 .\" FIXME elaborate on this
735 Some high priority levels may require superuser privileges (the
738 The priority can also be set in a protocol independent way by the
739 .RB ( SOL_SOCKET ", " SO_PRIORITY )
742 .\" Needs CAP_NET_ADMIN
744 .\" Since Linux 2.6.27
745 .\" Author: KOVACS Krisztian <hidden@sch.bme.hu>
746 .\" http://lwn.net/Articles/252545/
748 .BR IP_TRANSPARENT " (since Linux 2.6.24)"
749 .\" commit f5715aea4564f233767ea1d944b2637a5fd7cd2e
750 .\" This patch introduces the IP_TRANSPARENT socket option: enabling that
751 .\" will make the IPv4 routing omit the non-local source address check on
752 .\" output. Setting IP_TRANSPARENT requires NET_ADMIN capability.
753 .\" http://lwn.net/Articles/252545/
754 Setting this boolean option enables transparent proxying on this socket.
755 This socket option allows
756 the calling application to bind to a nonlocal IP address and operate
757 both as a client and a server with the foreign address as the local endpoint.
758 NOTE: this requires that routing be set up in a way that
759 packets going to the foreign address are routed through the TProxy box.
760 Enabling this socket option requires superuser privileges
765 TProxy redirection with the iptables TPROXY target also requires that
766 this option be set on the redirected socket.
768 .BR IP_TTL " (since Linux 1.0)"
769 Set or retrieve the current time-to-live field that is used in every packet
770 sent from this socket.
771 .\" FIXME Document IP_XFRM_POLICY
772 .\" Since Linux 2.5.48
773 .\" Needs CAP_NET_ADMIN
778 interfaces to configure some global parameters.
779 The parameters can be accessed by reading or writing files in the directory
780 .IR /proc/sys/net/ipv4/ .
781 .\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented:
784 Interfaces described as
786 take an integer value, with a nonzero value ("true") meaning that
787 the corresponding option is enabled, and a zero value ("false")
788 meaning that the option is disabled.
791 .IR ip_always_defrag " (Boolean; since Linux 2.2.13)"
792 [New with kernel 2.2.13; in earlier kernel versions this feature
793 was controlled at compile time by the
794 .B CONFIG_IP_ALWAYS_DEFRAG
795 option; this option is not present in 2.4.x and later]
797 When this boolean flag is enabled (not equal 0), incoming fragments
799 that arose when some host between origin and destination decided
800 that the packets were too large and cut them into pieces) will be
801 reassembled (defragmented) before being processed, even if they are
802 about to be forwarded.
804 Only enable if running either a firewall that is the sole link
805 to your network or a transparent proxy; never ever use it for a
806 normal router or host.
807 Otherwise fragmented communication can be disturbed
808 if the fragments travel over different links.
809 Defragmentation also has a large memory and CPU time cost.
811 This is automagically turned on when masquerading or transparent
812 proxying are configured.
815 .IR ip_autoconfig " (since Linux 2.2 to 2.6.17)"
816 .\" Precisely: since 2.1.68
817 .\" FIXME document ip_autoconfig
821 .IR ip_default_ttl " (integer; default: 64; since Linux 2.2)"
822 .\" Precisely: 2.1.15
823 Set the default time-to-live value of outgoing packets.
824 This can be changed per socket with the
829 .IR ip_dynaddr " (Boolean; default: disabled; since Linux 2.0.31)"
830 Enable dynamic socket address and masquerading entry rewriting on interface
832 This is useful for dialup interface with changing IP addresses.
833 0 means no rewriting, 1 turns it on and 2 enables verbose mode.
836 .IR ip_forward " (Boolean; default: disabled; since Linux 1.2)"
837 Enable IP forwarding with a boolean flag.
838 IP forwarding can be also set on a per-interface basis.
841 .IR ip_local_port_range " (since Linux 2.2)"
842 .\" Precisely: since 2.1.68
843 Contains two integers that define the default local port range
844 allocated to sockets.
845 Allocation starts with the first number and ends with the second number.
846 Note that these should not conflict with the ports used by masquerading
847 (although the case is handled).
848 Also arbitrary choices may cause problems with some firewall packet
849 filters that make assumptions about the local ports in use.
850 First number should be at least greater than 1024,
851 or better, greater than 4096, to avoid clashes
852 with well known ports and to minimize firewall problems.
855 .IR ip_no_pmtu_disc " (Boolean; default: disabled; since Linux 2.2)"
856 .\" Precisely: 2.1.15
857 If enabled, don't do Path MTU Discovery for TCP sockets by default.
858 Path MTU discovery may fail if misconfigured firewalls (that drop
859 all ICMP packets) or misconfigured interfaces (e.g., a point-to-point
860 link where the both ends don't agree on the MTU) are on the path.
861 It is better to fix the broken routers on the path than to turn off
862 Path MTU Discovery globally, because not doing it incurs a high cost
865 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
867 .IR ip_nonlocal_bind " (Boolean; default: disabled; since Linux 2.4)"
868 .\" Precisely: patch-2.4.0-test10
869 If set, allows processes to
871 to nonlocal IP addresses,
872 which can be quite useful, but may break some applications.
874 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
876 .IR ip6frag_time " (integer; default: 30)"
877 Time in seconds to keep an IPv6 fragment in memory.
879 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
881 .IR ip6frag_secret_interval " (integer; default: 600)"
882 Regeneration interval (in seconds) of the hash secret (or lifetime
883 for the hash secret) for IPv6 fragments.
885 .IR ipfrag_high_thresh " (integer), " ipfrag_low_thresh " (integer)"
886 If the amount of queued IP fragments reaches
887 .IR ipfrag_high_thresh ,
888 the queue is pruned down to
889 .IR ipfrag_low_thresh .
890 Contains an integer with the number of bytes.
895 .\" FIXME Document the conf/*/* interfaces
896 .\" FIXME Document the route/* interfaces
897 .\" FIXME document them all
899 All ioctls described in
904 .\" commented out the following because ipchains is obsolete
906 .\" The ioctls to configure firewalling are documented in
912 Ioctls to configure generic device parameters are described in
914 .\" FIXME Add a discussion of multicasting
916 .\" FIXME document all errors.
917 .\" We should really fix the kernels to give more uniform
918 .\" error returns (ENOMEM vs ENOBUFS, EPERM vs EACCES etc.)
921 The user tried to execute an operation without the necessary permissions.
923 sending a packet to a broadcast address without having the
926 sending a packet via a
929 modifying firewall settings without superuser privileges (the
932 binding to a privileged port without superuser privileges (the
933 .B CAP_NET_BIND_SERVICE
937 Tried to bind to an address already in use.
940 A nonexistent interface was requested or the requested source
941 address was not local.
944 Operation on a nonblocking socket would block.
947 An connection operation on a nonblocking socket is already in progress.
950 A connection was closed during an
954 No valid routing table entry matches the destination address.
955 This error can be caused by a ICMP message from a remote router or
956 for the local routing table.
959 Invalid argument passed.
960 For send operations this can be caused by sending to a
966 was called on an already connected socket.
969 Datagram is bigger than an MTU on the path and it cannot be fragmented.
971 .BR ENOBUFS ", " ENOMEM
972 Not enough free memory.
973 This often means that the memory allocation is limited by the socket
974 buffer limits, not by the system memory, but this is not 100% consistent.
978 was called on a socket where no packet arrived.
981 A kernel subsystem was not configured.
983 .BR ENOPROTOOPT " and " EOPNOTSUPP
984 Invalid socket option passed.
987 The operation is only defined on a connected socket, but the socket wasn't
991 User doesn't have permission to set high priority, change configuration,
992 or send signals to the requested process or group.
995 The connection was unexpectedly closed or shut down by the other end.
998 The socket is not configured or an unknown socket type was requested.
1000 Other errors may be generated by the overlaying protocols; see
1009 .BR IP_MTU_DISCOVER ,
1010 .BR IP_RECVORIGDSTADDR ,
1013 .BR IP_ROUTER_ALERT ,
1017 .\" IP_PASSSEC is Linux-specific
1018 .\" IP_XFRM_POLICY is Linux-specific
1019 .\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs
1021 Be very careful with the
1023 option \- it is not privileged in Linux.
1024 It is easy to overload the network
1025 with careless broadcasts.
1026 For new application protocols
1027 it is better to use a multicast group instead of broadcasting.
1028 Broadcasting is discouraged.
1030 Some other BSD sockets implementations provide
1034 socket options to get the destination address and the interface of
1036 Linux has the more general
1040 Some BSD sockets implementations also provide an
1042 option, but an ancillary message with type
1044 is passed with the incoming packet.
1045 This is different from the
1047 option used in Linux.
1051 socket options level isn't portable, BSD-based stacks use
1055 For compatibility with Linux 2.0, the obsolete
1056 .BI "socket(AF_INET, SOCK_PACKET, " protocol )
1057 syntax is still supported to open a
1060 This is deprecated and should be replaced by
1061 .BI "socket(AF_PACKET, SOCK_RAW, " protocol )
1063 The main difference is the new
1065 address structure for generic link layer information instead of the old
1068 There are too many inconsistent error values.
1070 The ioctls to configure IP-specific interface options and ARP tables are
1073 Some versions of glibc forget to declare
1075 Workaround currently is to copy it into your program from this man page.
1077 Receiving the original destination address with
1083 does not work in some 2.2 kernels.
1085 .\" This man page was written by Andi Kleen.
1091 .BR capabilities (7),
1098 RFC\ 791 for the original IP specification.
1100 RFC\ 1122 for the IPv4 host requirements.
1102 RFC\ 1812 for the IPv4 router requirements.
1103 .\" FIXME autobind INADDR REUSEADDR