summaryrefslogtreecommitdiffstats
path: root/share/man/man4/divert.4
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-05-25 08:44:31 +0000
committerjulian <julian@FreeBSD.org>1998-05-25 08:44:31 +0000
commit33ee3bc8fe78993299dd272d53460fed02ac7b91 (patch)
tree79f079da0d0038983fd5a450328b202795182ff4 /share/man/man4/divert.4
parent32d95890269b32e2d6156063f80005fa857b2ce0 (diff)
downloadFreeBSD-src-33ee3bc8fe78993299dd272d53460fed02ac7b91.zip
FreeBSD-src-33ee3bc8fe78993299dd272d53460fed02ac7b91.tar.gz
Hide the interface name in the sin_zero section of the sockaddr_in
passed to the user process for incoming packets. When the sockaddr_in is passed back to the divert socket later, use thi sas the primary interface lookup and only revert to the IP address when the name fails. This solves a long standing bug with divert sockets: When two interfaces had the same address (P2P for example) the interface "assigned" to the reinjected packet was sometimes incorect. Probably we should define a "sockaddr_div" to officially hold this extended information in teh same manner as sockaddr_dl.
Diffstat (limited to 'share/man/man4/divert.4')
-rw-r--r--share/man/man4/divert.414
1 files changed, 11 insertions, 3 deletions
diff --git a/share/man/man4/divert.4 b/share/man/man4/divert.4
index b9aa0fb..522946c 100644
--- a/share/man/man4/divert.4
+++ b/share/man/man4/divert.4
@@ -1,4 +1,4 @@
-.\" $Id: divert.4,v 1.9 1997/11/08 01:02:08 brian Exp $
+.\" $Id: divert.4,v 1.10 1998/03/12 07:30:16 charnier Exp $
.\"
.Dd June 18, 1996
.Dt DIVERT 4
@@ -47,7 +47,9 @@ the divert port and the IP address set to the (first) address of
the interface on which the packet was received (if the packet
was incoming) or
.Dv INADDR_ANY
-(if the packet was outgoing).
+(if the packet was outgoing). In the case of an incoming packet the interface
+name will also be placed in the 8 bytes following the address,
+(assuming it fits).
.Sh WRITING PACKETS
Writing to a divert socket is similar to writing to a raw IP socket;
the packet is injected ``as is'' into the normal kernel IP packet
@@ -66,7 +68,13 @@ for a non-local address. Otherwise, the packet is assumed to be
incoming and full packet routing is done.
.Pp
In the latter case, the
-IP address specified must match the address of some local interface.
+IP address specified must match the address of some local interface,
+or an interface name
+must be found after the IP address. If an interface name is found,
+that interface will be used and the value of the IP address will be
+ignored (other than the fact that it is not
+.Dv INADDR_ANY
+).
This is to indicate on which interface the packet ``arrived.''
.Pp
Normally, packets read as incoming should be written as incoming;
OpenPOWER on IntegriCloud