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 2010-10-24 "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
315 The don't-fragment flag is set on all outgoing datagrams.
316 The system-wide default is controlled by the
317 .I /proc/sys/net/ipv4/ip_no_pmtu_disc
320 sockets, and disabled on all others.
323 sockets, it is the user's responsibility to packetize the data
324 in MTU sized chunks and to do the retransmits if necessary.
325 The kernel will reject packets that are bigger than the known
326 path MTU if this flag is set (with
333 Path MTU discovery flags:Meaning
334 IP_PMTUDISC_WANT:Use per-route settings.
335 IP_PMTUDISC_DONT:Never do Path MTU Discovery.
336 IP_PMTUDISC_DO:Always do Path MTU Discovery.
337 IP_PMTUDISC_PROBE:Set DF but ignore Path MTU.
340 When PMTU discovery is enabled, the kernel automatically keeps track of
341 the path MTU per destination host.
342 When it is connected to a specific peer with
344 the currently known path MTU can be retrieved conveniently using the
346 socket option (e.g., after a
349 It may change over time.
350 For connectionless sockets with many destinations,
351 the new MTU for a given destination can also be accessed using the
354 A new error will be queued for every incoming MTU update.
356 While MTU discovery is in progress, initial packets from datagram sockets
358 Applications using UDP should be aware of this and not
359 take it into account for their packet retransmit strategy.
361 To bootstrap the path MTU discovery process on unconnected sockets, it
362 is possible to start with a big datagram size
363 (up to 64K-headers bytes long) and let it shrink by updates of the path MTU.
364 .\" FIXME this is an ugly hack
366 To get an initial estimate of the
367 path MTU, connect a datagram socket to the destination address using
369 and retrieve the MTU by calling
375 It is possible to implement RFC 4821 MTU probing with
379 sockets by setting a value of
380 .BR IP_PMTUDISC_PROBE
381 (available since Linux 2.6.22).
382 This is also particularly useful for diagnostic tools such as
384 that wish to deliberately send probe packets larger than
385 the observed Path MTU.
387 .BR IP_MULTICAST_IF " (since Linux 1.2)"
388 Set the local device for a multicast socket.
394 .BR IP_ADD_MEMBERSHIP .
396 When an invalid socket option is passed,
400 .BR IP_MULTICAST_LOOP " (since Linux 1.2)"
401 Set or read a boolean integer argument that determines whether
402 sent multicast packets should be looped back to the local sockets.
404 .BR IP_MULTICAST_TTL " (since Linux 1.2)"
405 Set or read the time-to-live value of outgoing multicast packets for this
407 It is very important for multicast packets to set the smallest TTL possible.
408 The default is 1 which means that multicast packets don't leave the local
409 network unless the user program explicitly requests it.
410 Argument is an integer.
412 .BR IP_NODEFRAG " (since Linux 2.6.36)"
413 If enabled (argument is nonzero),
414 the reassembly of outgoing packets is disabled in the netfilter layer.
415 This option is only valid for
418 The argument is an integer.
420 .BR IP_OPTIONS " (since Linux 2.0)"
421 .\" Precisely: 1.3.30
422 Set or get the IP options to be sent with every packet from this socket.
423 The arguments are a pointer to a memory buffer containing the options
424 and the option length.
427 call sets the IP options associated with a socket.
428 The maximum option size for IPv4 is 40 bytes.
429 See RFC\ 791 for the allowed options.
430 When the initial connection request packet for a
432 socket contains IP options, the IP options will be set automatically
433 to the options from the initial packet with routing headers reversed.
434 Incoming packets are not allowed to change options after the connection
436 The processing of all incoming source routing options
437 is disabled by default and can be enabled by using the
438 .I accept_source_route
441 Other options like timestamps are still handled.
442 For datagram sockets, IP options can be only set by the local user.
447 puts the current IP options used for sending into the supplied buffer.
448 .\" FIXME Document IP_PASSSEC
450 .\" Since Linux 2.6.17
451 .\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c
452 .\" Author: Catherine Zhang <cxzhang@watson.ibm.com>
454 .BR IP_PKTINFO " (since Linux 2.2)"
455 .\" Precisely: 2.1.68
458 ancillary message that contains a
460 structure that supplies some information about the incoming packet.
461 This only works for datagram oriented sockets.
462 The argument is a flag that tells the socket whether the
464 message should be passed or not.
465 The message itself can only be sent/retrieved
466 as control message with a packet using
474 unsigned int ipi_ifindex; /* Interface index */
475 struct in_addr ipi_spec_dst; /* Local address */
476 struct in_addr ipi_addr; /* Header Destination
482 .\" FIXME elaborate on that.
484 is the unique index of the interface the packet was received on.
486 is the local address of the packet and
488 is the destination address in the packet header.
494 .\" This field is grossly misnamed
496 is not zero, then it is used as the local source address for the routing
497 table lookup and for setting up IP source route options.
500 is not zero, the primary local address of the interface specified by the
503 for the routing table lookup.
505 .BR IP_RECVERR " (since Linux 2.2)"
506 .\" Precisely: 2.1.15
507 Enable extended reliable error message passing.
508 When enabled on a datagram socket, all
509 generated errors will be queued in a per-socket error queue.
510 When the user receives an error from a socket operation,
511 the errors can be received by calling
518 structure describing the error will be passed in an ancillary message with
523 .\" or SOL_IP on Linux
524 This is useful for reliable error handling on unconnected sockets.
525 The received data portion of the error queue contains the error packet.
529 control message contains a
536 #define SO_EE_ORIGIN_NONE 0
537 #define SO_EE_ORIGIN_LOCAL 1
538 #define SO_EE_ORIGIN_ICMP 2
539 #define SO_EE_ORIGIN_ICMP6 3
541 struct sock_extended_err {
542 uint32_t ee_errno; /* error number */
543 uint8_t ee_origin; /* where the error originated */
544 uint8_t ee_type; /* type */
545 uint8_t ee_code; /* code */
547 uint32_t ee_info; /* additional information */
548 uint32_t ee_data; /* other data */
549 /* More data may follow */
552 struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
559 number of the queued error.
561 is the origin code of where the error originated.
562 The other fields are protocol-specific.
565 returns a pointer to the address of the network object
566 where the error originated from given a pointer to the ancillary message.
567 If this address is not known, the
573 and the other fields of the
579 structure as follows:
583 for errors received as an ICMP packet, or
584 .B SO_EE_ORIGIN_LOCAL
585 for locally generated errors.
586 Unknown values should be ignored.
590 are set from the type and code fields of the ICMP header.
592 contains the discovered MTU for
595 The message also contains the
596 .I sockaddr_in of the node
597 caused the error, which can be accessed with the
606 when the source was unknown.
607 When the error originated from the network, all IP options
608 .RB ( IP_OPTIONS ", " IP_TTL ", "
609 etc.) enabled on the socket and contained in the
610 error packet are passed as control messages.
611 The payload of the packet causing the error is returned as normal payload.
612 .\" FIXME . Is it a good idea to document that? It is a dubious feature.
617 .\" has slightly different semantics. Instead of
618 .\" saving the errors for the next timeout, it passes all incoming
619 .\" errors immediately to the user.
620 .\" This might be useful for very short-lived TCP connections which
621 .\" need fast error handling. Use this option with care:
622 .\" it makes TCP unreliable
623 .\" by not allowing it to recover properly from routing
624 .\" shifts and other normal
625 .\" conditions and breaks the protocol specification.
626 Note that TCP has no error queue;
632 is valid for TCP, but all errors are returned by socket function return or
638 enables passing of all received ICMP errors to the
639 application, otherwise errors are only reported on connected sockets
641 It sets or retrieves an integer boolean flag.
645 .BR IP_RECVOPTS " (since Linux 2.2)"
646 .\" Precisely: 2.1.15
647 Pass all incoming IP options to the user in a
650 The routing header and other options are already filled in
656 .BR IP_RECVORIGDSTADDR " (since Linux 2.6.29)"
657 .\" commit e8b2dfe9b4501ed0047459b2756ba26e5a940a69
658 This boolean option enables the
662 in which the kernel returns the original destination address
663 of the datagram being received.
664 The ancillary message contains a
665 .IR "struct sockaddr_in" .
667 .BR IP_RECVTOS " (since Linux 2.2)"
668 .\" Precisely: 2.1.68
671 ancillary message is passed with incoming packets.
672 It contains a byte which specifies the Type of Service/Precedence
673 field of the packet header.
674 Expects a boolean integer flag.
676 .BR IP_RECVTTL " (since Linux 2.2)"
677 .\" Precisely: 2.1.68
678 When this flag is set, pass a
680 control message with the time to live
681 field of the received packet as a byte.
686 .BR IP_RETOPTS " (since Linux 2.2)"
687 .\" Precisely: 2.1.15
690 but returns raw unprocessed options with timestamp and route record
691 options not filled in for this hop.
693 .BR IP_ROUTER_ALERT " (since Linux 2.2)"
694 .\" Precisely: 2.1.68
695 Pass all to-be forwarded packets with the
696 IP Router Alert option set to this socket.
697 Only valid for raw sockets.
698 This is useful, for instance, for user-space RSVP daemons.
699 The tapped packets are not forwarded by the kernel; it is
700 the user's responsibility to send them out again.
701 Socket binding is ignored,
702 such packets are only filtered by protocol.
703 Expects an integer flag.
705 .BR IP_TOS " (since Linux 1.0)"
706 Set or receive the Type-Of-Service (TOS) field that is sent
707 with every IP packet originating from this socket.
708 It is used to prioritize packets on the network.
710 There are some standard TOS flags defined:
712 to minimize delays for interactive traffic,
714 to optimize throughput,
716 to optimize for reliability,
718 should be used for "filler data" where slow transmission doesn't matter.
719 At most one of these TOS values can be specified.
720 Other bits are invalid and shall be cleared.
723 datagrams first by default,
724 but the exact behavior depends on the configured queueing discipline.
725 .\" FIXME elaborate on this
726 Some high priority levels may require superuser privileges (the
729 The priority can also be set in a protocol independent way by the
730 .RB ( SOL_SOCKET ", " SO_PRIORITY )
733 .\" Needs CAP_NET_ADMIN
735 .\" Since Linux 2.6.27
736 .\" Author: KOVACS Krisztian <hidden@sch.bme.hu>
737 .\" http://lwn.net/Articles/252545/
739 .BR IP_TRANSPARENT " (since Linux 2.6.24)"
740 .\" commit f5715aea4564f233767ea1d944b2637a5fd7cd2e
741 .\" This patch introduces the IP_TRANSPARENT socket option: enabling that
742 .\" will make the IPv4 routing omit the non-local source address check on
743 .\" output. Setting IP_TRANSPARENT requires NET_ADMIN capability.
744 .\" http://lwn.net/Articles/252545/
745 Setting this boolean option enables transparent proxying on this socket.
746 This socket option allows
747 the calling application to bind to a nonlocal IP address and operate
748 both as a client and a server with the foreign address as the local endpoint.
749 NOTE: this requires that routing be set up in a way that
750 packets going to the foreign address are routed through the TProxy box.
751 Enabling this socket option requires superuser privileges
756 TProxy redirection with the iptables TPROXY target also requires that
757 this option be set on the redirected socket.
759 .BR IP_TTL " (since Linux 1.0)"
760 Set or retrieve the current time-to-live field that is used in every packet
761 sent from this socket.
762 .\" FIXME Document IP_XFRM_POLICY
763 .\" Since Linux 2.5.48
764 .\" Needs CAP_NET_ADMIN
769 interfaces to configure some global parameters.
770 The parameters can be accessed by reading or writing files in the directory
771 .IR /proc/sys/net/ipv4/ .
772 .\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented:
775 Interfaces described as
777 take an integer value, with a nonzero value ("true") meaning that
778 the corresponding option is enabled, and a zero value ("false")
779 meaning that the option is disabled.
782 .IR ip_always_defrag " (Boolean; since Linux 2.2.13)"
783 [New with kernel 2.2.13; in earlier kernel versions this feature
784 was controlled at compile time by the
785 .B CONFIG_IP_ALWAYS_DEFRAG
786 option; this option is not present in 2.4.x and later]
788 When this boolean flag is enabled (not equal 0), incoming fragments
790 that arose when some host between origin and destination decided
791 that the packets were too large and cut them into pieces) will be
792 reassembled (defragmented) before being processed, even if they are
793 about to be forwarded.
795 Only enable if running either a firewall that is the sole link
796 to your network or a transparent proxy; never ever use it for a
797 normal router or host.
798 Otherwise fragmented communication can be disturbed
799 if the fragments travel over different links.
800 Defragmentation also has a large memory and CPU time cost.
802 This is automagically turned on when masquerading or transparent
803 proxying are configured.
806 .IR ip_autoconfig " (since Linux 2.2 to 2.6.17)"
807 .\" Precisely: since 2.1.68
808 .\" FIXME document ip_autoconfig
812 .IR ip_default_ttl " (integer; default: 64; since Linux 2.2)"
813 .\" Precisely: 2.1.15
814 Set the default time-to-live value of outgoing packets.
815 This can be changed per socket with the
820 .IR ip_dynaddr " (Boolean; default: disabled; since Linux 2.0.31)"
821 Enable dynamic socket address and masquerading entry rewriting on interface
823 This is useful for dialup interface with changing IP addresses.
824 0 means no rewriting, 1 turns it on and 2 enables verbose mode.
827 .IR ip_forward " (Boolean; default: disabled; since Linux 1.2)"
828 Enable IP forwarding with a boolean flag.
829 IP forwarding can be also set on a per-interface basis.
832 .IR ip_local_port_range " (since Linux 2.2)"
833 .\" Precisely: since 2.1.68
834 Contains two integers that define the default local port range
835 allocated to sockets.
836 Allocation starts with the first number and ends with the second number.
837 Note that these should not conflict with the ports used by masquerading
838 (although the case is handled).
839 Also arbitrary choices may cause problems with some firewall packet
840 filters that make assumptions about the local ports in use.
841 First number should be at least greater than 1024,
842 or better, greater than 4096, to avoid clashes
843 with well known ports and to minimize firewall problems.
846 .IR ip_no_pmtu_disc " (Boolean; default: disabled; since Linux 2.2)"
847 .\" Precisely: 2.1.15
848 If enabled, don't do Path MTU Discovery for TCP sockets by default.
849 Path MTU discovery may fail if misconfigured firewalls (that drop
850 all ICMP packets) or misconfigured interfaces (e.g., a point-to-point
851 link where the both ends don't agree on the MTU) are on the path.
852 It is better to fix the broken routers on the path than to turn off
853 Path MTU Discovery globally, because not doing it incurs a high cost
856 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
858 .IR ip_nonlocal_bind " (Boolean; default: disabled; since Linux 2.4)"
859 .\" Precisely: patch-2.4.0-test10
860 If set, allows processes to
862 to nonlocal IP addresses,
863 which can be quite useful, but may break some applications.
865 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
867 .IR ip6frag_time " (integer; default: 30)"
868 Time in seconds to keep an IPv6 fragment in memory.
870 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
872 .IR ip6frag_secret_interval " (integer; default: 600)"
873 Regeneration interval (in seconds) of the hash secret (or lifetime
874 for the hash secret) for IPv6 fragments.
876 .IR ipfrag_high_thresh " (integer), " ipfrag_low_thresh " (integer)"
877 If the amount of queued IP fragments reaches
878 .IR ipfrag_high_thresh ,
879 the queue is pruned down to
880 .IR ipfrag_low_thresh .
881 Contains an integer with the number of bytes.
886 .\" FIXME Document the conf/*/* interfaces
887 .\" FIXME Document the route/* interfaces
888 .\" FIXME document them all
890 All ioctls described in
895 .\" commented out the following because ipchains is obsolete
897 .\" The ioctls to configure firewalling are documented in
903 Ioctls to configure generic device parameters are described in
905 .\" FIXME Add a discussion of multicasting
907 .\" FIXME document all errors.
908 .\" We should really fix the kernels to give more uniform
909 .\" error returns (ENOMEM vs ENOBUFS, EPERM vs EACCES etc.)
912 The user tried to execute an operation without the necessary permissions.
914 sending a packet to a broadcast address without having the
917 sending a packet via a
920 modifying firewall settings without superuser privileges (the
923 binding to a privileged port without superuser privileges (the
924 .B CAP_NET_BIND_SERVICE
928 Tried to bind to an address already in use.
931 A nonexistent interface was requested or the requested source
932 address was not local.
935 Operation on a nonblocking socket would block.
938 An connection operation on a nonblocking socket is already in progress.
941 A connection was closed during an
945 No valid routing table entry matches the destination address.
946 This error can be caused by a ICMP message from a remote router or
947 for the local routing table.
950 Invalid argument passed.
951 For send operations this can be caused by sending to a
957 was called on an already connected socket.
960 Datagram is bigger than an MTU on the path and it cannot be fragmented.
962 .BR ENOBUFS ", " ENOMEM
963 Not enough free memory.
964 This often means that the memory allocation is limited by the socket
965 buffer limits, not by the system memory, but this is not 100% consistent.
969 was called on a socket where no packet arrived.
972 A kernel subsystem was not configured.
974 .BR ENOPROTOOPT " and " EOPNOTSUPP
975 Invalid socket option passed.
978 The operation is only defined on a connected socket, but the socket wasn't
982 User doesn't have permission to set high priority, change configuration,
983 or send signals to the requested process or group.
986 The connection was unexpectedly closed or shut down by the other end.
989 The socket is not configured or an unknown socket type was requested.
991 Other errors may be generated by the overlaying protocols; see
1000 .BR IP_MTU_DISCOVER ,
1001 .BR IP_RECVORIGDSTADDR ,
1004 .BR IP_ROUTER_ALERT ,
1008 .\" IP_PASSSEC is Linux-specific
1009 .\" IP_XFRM_POLICY is Linux-specific
1010 .\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs
1012 Be very careful with the
1014 option \- it is not privileged in Linux.
1015 It is easy to overload the network
1016 with careless broadcasts.
1017 For new application protocols
1018 it is better to use a multicast group instead of broadcasting.
1019 Broadcasting is discouraged.
1021 Some other BSD sockets implementations provide
1025 socket options to get the destination address and the interface of
1027 Linux has the more general
1031 Some BSD sockets implementations also provide an
1033 option, but an ancillary message with type
1035 is passed with the incoming packet.
1036 This is different from the
1038 option used in Linux.
1042 socket options level isn't portable, BSD-based stacks use
1046 For compatibility with Linux 2.0, the obsolete
1047 .BI "socket(AF_INET, SOCK_PACKET, " protocol )
1048 syntax is still supported to open a
1051 This is deprecated and should be replaced by
1052 .BI "socket(AF_PACKET, SOCK_RAW, " protocol )
1054 The main difference is the new
1056 address structure for generic link layer information instead of the old
1059 There are too many inconsistent error values.
1061 The ioctls to configure IP-specific interface options and ARP tables are
1064 Some versions of glibc forget to declare
1066 Workaround currently is to copy it into your program from this man page.
1068 Receiving the original destination address with
1074 does not work in some 2.2 kernels.
1076 .\" This man page was written by Andi Kleen.
1082 .BR capabilities (7),
1089 RFC\ 791 for the original IP specification.
1091 RFC\ 1122 for the IPv4 host requirements.
1093 RFC\ 1812 for the IPv4 router requirements.
1094 .\" FIXME autobind INADDR REUSEADDR