Talk a bit about sockets that are bound before ppp changes
its IP number.
This commit is contained in:
parent
4206e13f22
commit
15d57161a2
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=2401
1 changed files with 49 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
<!-- $Id: network.sgml,v 1.6 1998-01-20 22:48:19 brian Exp $ -->
|
||||
<!-- $Id: network.sgml,v 1.7 1998-01-29 00:40:02 brian Exp $ -->
|
||||
<!-- The FreeBSD Documentation Project -->
|
||||
|
||||
<sect>
|
||||
|
@ -630,6 +630,54 @@ default 10.0.0.2 UGSc 0 0 tun0
|
|||
other bits and pieces such as what actually caused the dump and
|
||||
the addresses & values of the relevant variables.
|
||||
|
||||
<sect2>
|
||||
<heading>
|
||||
The process that forces a dial in auto mode never connects
|
||||
</heading>
|
||||
|
||||
<p>This is a known problem when <bf/ppp/ is set up to negotiate
|
||||
a dynamic local IP number with the peer. When that initial program
|
||||
calls <htmlurl url="http://www.freebsd.org/cgi/man.cgi?connect"
|
||||
name="connect(2)">, the IP number of the tun interface is
|
||||
assigned to the socket endpoint. The kernel creates the first
|
||||
outgoing packet and writes it to the tun device. <bf/Ppp/ then
|
||||
reads the packet and establishes a connection. If, as a result
|
||||
of <bf/ppp/s dynamic IP assignment, the interface address is changed,
|
||||
the original socket endpoint will be invalid. Any subsequent
|
||||
packets sent to the peer will usually be dropped. Even if
|
||||
they aren't, any responses will not route back to the originating
|
||||
machine as the IP number is no longer owned by that machine.
|
||||
|
||||
<p>There are several theoretical ways to approach this problem.
|
||||
It would be nicest if the peer would re-assign the same IP number
|
||||
if possible <tt/:-)/
|
||||
|
||||
<p>The easiest method from our side would be to never change the
|
||||
tun interface IP number, but instead to change all outgoing packets
|
||||
so that the source IP number is changed from the interface IP to
|
||||
the negotiated IP on the fly. This is essentially what
|
||||
<htmlurl url="http://www.freebsd.org/cgi/man.cgi?libalias"
|
||||
name="libalias(3)"> (and ppp's <bf/-alias/ switch) already does.
|
||||
|
||||
<p>Another alternative (and probably the most reliable) is to
|
||||
implement a system call that changes all bound sockets from one
|
||||
IP to another. <bf/Ppp/ would use this call to modify the
|
||||
sockets of all existing programs when a new IP number is
|
||||
negotiated.
|
||||
|
||||
<p>A third possibility is to allow an interface to be brought
|
||||
up without an IP number. Outgoing packets would be given
|
||||
an IP number of 255.255.255.255 up until the first SIOCAIFADDR
|
||||
ioctl is done. This would result in fully binding the socket. It
|
||||
would be up to <bf/ppp/ to change the source IP number, but only if
|
||||
it's set to 255.255.255.255, and only the IP number and IP checksum
|
||||
would need to change. This, however is a bit of a hack as
|
||||
the kernel would be sending bad packets to an improperly
|
||||
configured interface, on the assumption that some other mechanism
|
||||
is capable of fixing things retrospectively.
|
||||
|
||||
<p>None of these solutions has been implemented (yet).
|
||||
|
||||
<sect2>
|
||||
<heading>None of this helps - I'm desperate !</heading>
|
||||
|
||||
|
|
Loading…
Reference in a new issue