raw.7: grfix

This commit is contained in:
Michael Kerrisk 2008-11-21 21:36:44 -05:00
parent 2a4ed4153d
commit fc59cb811b
1 changed files with 18 additions and 18 deletions

View File

@ -66,19 +66,19 @@ is specified and the IP header has a non-zero destination address then
the destination address of the socket is used to route the packet.
When
.B MSG_DONTROUTE
is specified the destination address should refer to a local interface,
is specified, the destination address should refer to a local interface,
otherwise a routing table lookup is done anyway but gatewayed routes
are ignored.
If
.B IP_HDRINCL
isn't set then IP header options can be set on raw sockets with
isn't set, then IP header options can be set on raw sockets with
.BR setsockopt (2);
see
.BR ip (7)
for more information.
In Linux 2.2 all IP header fields and options can be set using
In Linux 2.2, all IP header fields and options can be set using
IP socket options.
This means raw sockets are usually only needed for new
protocols or protocols with no user interface (like ICMP).
@ -95,8 +95,8 @@ The
.I sin_port
field could be used to specify the IP protocol number,
but it is ignored for sending in Linux 2.2 and should be always
set to 0 (see BUGS)
For incoming packets
set to 0 (see BUGS).
For incoming packets,
.I sin_port
is set to the protocol of the packet.
See the
@ -120,7 +120,7 @@ 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
In addition all
In addition, all
.BR ip (7)
.B IPPROTO_IP
socket options valid for datagram sockets are supported.
@ -129,13 +129,13 @@ Errors originating from the network are only passed to the user when the
socket is connected or the
.B IP_RECVERR
flag is enabled.
For connected sockets only
For connected sockets, only
.B EMSGSIZE
and
.B EPROTO
are passed for compatibility.
With
.B IP_RECVERR
.BR IP_RECVERR ,
all network errors are saved in the error queue.
.SH ERRORS
.TP
@ -181,12 +181,12 @@ raw socket code when the
socket option was set \(em since Linux 2.2,
this option no longer has that effect.
.SH NOTES
By default raw sockets do path MTU (Maximum Transmission Unit) discovery.
By default, raw sockets do path MTU (Maximum Transmission Unit) discovery.
This means the kernel
will keep track of the MTU to a specific target IP address and return
.B EMSGSIZE
when a raw packet write exceeds it.
When this happens the application should decrease the packet size.
When this happens, the application should decrease the packet size.
Path MTU discovery can be also turned off using the
.B IP_MTU_DISCOVER
socket option or the
@ -194,16 +194,16 @@ socket option or the
file, see
.BR ip (7)
for details.
When turned off raw sockets will fragment outgoing packets
When turned off, raw sockets will fragment outgoing packets
that exceed the interface MTU.
However disabling it is not recommended
However, disabling it is not recommended
for performance and reliability reasons.
A raw socket can be bound to a specific local address using the
.BR bind (2)
call.
If it isn't bound all packets with the specified IP protocol are received.
In addition a RAW socket can be bound to a specific network device using
If it isn't bound, all packets with the specified IP protocol are received.
In addition, a RAW socket can be bound to a specific network device using
.BR SO_BINDTODEVICE ;
see
.BR socket (7).
@ -211,7 +211,7 @@ see
An
.B IPPROTO_RAW
socket is send only.
If you really want to receive all IP packets use a
If you really want to receive all IP packets, use a
.BR packet (7)
socket with the
.B ETH_P_IP
@ -219,7 +219,7 @@ protocol.
Note that packet sockets don't reassemble IP fragments,
unlike raw sockets.
If you want to receive all ICMP packets for a datagram socket
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
@ -227,7 +227,7 @@ on that particular socket; see
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
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.
@ -250,7 +250,7 @@ Transparent proxy extensions are not described.
When the
.B IP_HDRINCL
option is set datagrams will not be fragmented and are limited to
option is set, datagrams will not be fragmented and are limited to
the interface MTU.
Setting the IP protocol for sending in