diff options
Diffstat (limited to 'man7/raw.7')
-rw-r--r-- | man7/raw.7 | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -5,7 +5,7 @@ .\" .\" $Id: raw.7,v 1.6 1999/06/05 10:32:08 freitag Exp $ .\" -.TH raw 7 2023-07-15 "Linux man-pages 6.05.01" +.TH raw 7 2023-10-31 "Linux man-pages 6.7" .SH NAME raw \- Linux IPv4 raw sockets .SH SYNOPSIS @@ -18,17 +18,17 @@ raw \- Linux IPv4 raw sockets Raw sockets allow new IPv4 protocols to be implemented in user space. A raw socket receives or sends the raw datagram not including link level headers. -.PP +.P The IPv4 layer generates an IP header when sending a packet unless the .B IP_HDRINCL socket option is enabled on the socket. When it is enabled, the packet must contain an IP header. For receiving, the IP header is always included in the packet. -.PP +.P In order to create a raw socket, a process must have the .B CAP_NET_RAW capability in the user namespace that governs its network namespace. -.PP +.P All packets or errors matching the .I protocol number specified @@ -39,7 +39,7 @@ see the IANA list of assigned protocol numbers at .UE and .BR getprotobyname (3). -.PP +.P A protocol of .B IPPROTO_RAW implies enabled @@ -61,7 +61,7 @@ Packet ID:Filled in when zero Total Length:Always filled in .TE .RE -.PP +.P If .B IP_HDRINCL is specified and the IP header has a nonzero destination address, then @@ -71,7 +71,7 @@ When is specified, the destination address should refer to a local interface, otherwise a routing table lookup is done anyway but gatewayed routes are ignored. -.PP +.P If .B IP_HDRINCL isn't set, then IP header options can be set on raw sockets with @@ -79,12 +79,12 @@ isn't set, then IP header options can be set on raw sockets with see .BR ip (7) for more information. -.PP +.P Starting with Linux 2.2, all IP header fields and options can be set using IP socket options. This means raw sockets are usually needed only for new protocols or protocols with no user interface (like ICMP). -.PP +.P When a packet is received, it is passed to any raw sockets which have been bound to its protocol before it is passed to other protocol handlers (e.g., kernel protocol modules). @@ -123,7 +123,7 @@ protocol. The value has a bit set for each ICMP message type which should be filtered out. The default is to filter no ICMP messages. -.PP +.P In addition, all .BR ip (7) .B IPPROTO_IP @@ -178,7 +178,7 @@ and .B ICMP_FILTER are new in Linux 2.2. They are Linux extensions and should not be used in portable programs. -.PP +.P Linux 2.0 enabled some bug-to-bug compatibility with BSD in the raw socket code when the .B SO_BSDCOMPAT @@ -202,7 +202,7 @@ When turned off, raw sockets will fragment outgoing packets that exceed the interface MTU. However, disabling it is not recommended for performance and reliability reasons. -.PP +.P A raw socket can be bound to a specific local address using the .BR bind (2) call. @@ -211,7 +211,7 @@ In addition, a raw socket can be bound to a specific network device using .BR SO_BINDTODEVICE ; see .BR socket (7). -.PP +.P An .B IPPROTO_RAW socket is send only. @@ -222,28 +222,28 @@ socket with the protocol. Note that packet sockets don't reassemble IP fragments, unlike raw sockets. -.PP +.P If you want to receive all ICMP packets for a datagram socket, it is often better to use .B IP_RECVERR on that particular socket; see .BR ip (7). -.PP +.P Raw sockets may tap all IP protocols in Linux, even protocols like ICMP or TCP which have a protocol module in the kernel. In this case, the packets are passed to both the kernel module and the raw socket(s). This should not be relied upon in portable programs, many other BSD socket implementation have limitations here. -.PP +.P Linux never changes headers passed from the user (except for filling in some zeroed fields as described for .BR IP_HDRINCL ). This differs from many other implementations of raw sockets. -.PP +.P Raw sockets are generally rather unportable and should be avoided in programs intended to be portable. -.PP +.P Sending on raw sockets should take the IP protocol from .IR sin_port ; this ability was lost in Linux 2.2. @@ -251,12 +251,12 @@ The workaround is to use .BR IP_HDRINCL . .SH BUGS Transparent proxy extensions are not described. -.PP +.P When the .B IP_HDRINCL option is set, datagrams will not be fragmented and are limited to the interface MTU. -.PP +.P Setting the IP protocol for sending in .I sin_port got lost in Linux 2.2. @@ -272,7 +272,7 @@ call is always used. .BR capabilities (7), .BR ip (7), .BR socket (7) -.PP +.P .B RFC\ 1191 for path MTU discovery. .B RFC\ 791 |