summaryrefslogtreecommitdiffstats
path: root/share/man/man4/ip.4
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-06-15 01:08:09 +0000
committerbms <bms@FreeBSD.org>2004-06-15 01:08:09 +0000
commitdbea17bc836a776fa427415dc4237de9512858bb (patch)
treeb1c10604ba8a9bd5e8e7ed2f3c7e34307ebb0cba /share/man/man4/ip.4
parent52f66d087920043fa401e32440c2257bdc0fe0d9 (diff)
downloadFreeBSD-src-dbea17bc836a776fa427415dc4237de9512858bb.zip
FreeBSD-src-dbea17bc836a776fa427415dc4237de9512858bb.tar.gz
Add a paragraph about the importance of byte order when using raw
sockets with the IP_HDRINCL option. Add a list entry about the errors which IP_HDRINCL can return. Bump .Dd. PR: docs/30873 Submitted by: Douglas De Couto Obtained from: BSD/OS (byte order), some old libnet stuff I did years ago.
Diffstat (limited to 'share/man/man4/ip.4')
-rw-r--r--share/man/man4/ip.424
1 files changed, 23 insertions, 1 deletions
diff --git a/share/man/man4/ip.4 b/share/man/man4/ip.4
index b82e421..1377941 100644
--- a/share/man/man4/ip.4
+++ b/share/man/man4/ip.4
@@ -32,7 +32,7 @@
.\" @(#)ip.4 8.2 (Berkeley) 11/30/93
.\" $FreeBSD$
.\"
-.Dd March 3, 2001
+.Dd June 14, 2004
.Dt IP 4
.Os
.Sh NAME
@@ -529,6 +529,14 @@ ip->ip_id = 0; /* 0 means kernel set appropriate value */
ip->ip_off = offset;
.Ed
.Pp
+The ip_len and ip_off fields
+.Em must be provided in host byte order .
+All other fields must be provided in network byte order.
+See
+.Xr byteorder 4
+for more information on network byte order.
+If the ip_id field is set to 0, then the kernel will choose an
+appopriate value.
If the header source address is set to
.Dv INADDR_ANY ,
the kernel will choose an appropriate address.
@@ -568,10 +576,24 @@ The IP option field was improperly formed;
an option field was shorter than the minimum value
or longer than the option buffer provided.
.El
+.Pp
+The following errors may occur when attempting to send
+.Tn IP
+datagrams via a
+.Dq raw socket
+with the
+.Em IP_HDRINCL
+option set:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The user-supplied ip_len field was not equal to the length of the datagram
+written to the socket.
+.El
.Sh SEE ALSO
.Xr getsockopt 2 ,
.Xr recv 2 ,
.Xr send 2 ,
+.Xr byteorder 4 ,
.Xr icmp 4 ,
.Xr inet 4 ,
.Xr intro 4
OpenPOWER on IntegriCloud