Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Mar 2011 20:11:00 +0000
From:      Melissa Jenkins <melissa-freebsd@littlebluecar.co.uk>
To:        freebsd-net@freebsd.org
Cc:        Qing Li <qing.li@bluecoat.com>
Subject:   Re: PPP and Route Delete
Message-ID:  <FBC82712-5E6D-43B7-B716-87615BFCF6B3@littlebluecar.co.uk>
In-Reply-To: <B583FBF374231F4A89607B4D08578A430823C9CF@bcs-mail03.internal.cacheflow.com>
References:  <63A5C79A-B4C3-42C3-9B76-1F2EB04DB871@littlebluecar.co.uk><01EE1F52-3393-4A43-882F-C35677CB0754@gmail.com> <F850408F-1FCF-4817-BB62-6C6CD968FB92@littlebluecar.co.uk> <B583FBF374231F4A89607B4D08578A430823C9CF@bcs-mail03.internal.cacheflow.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> The self-pointing route 10.0.5.1 should have multiple references set =
on
> it, and that route won't be deleted from the routing table until the=20=

> last reference is removed.
>=20
> You can verify that by checking the "netstat" output, the "Ref" column
> after tun1 has been created.

Unfortunately PPP doesn't increase the reference count:

After connecting 1 VPN:
Destination        Gateway            Flags    Refs      Use  Netif =
Expire
10.0.5.1           link#12            UHS         0        0    lo0

After connecting the second VPN:
Destination        Gateway            Flags    Refs      Use  Netif =
Expire
10.0.5.1           link#12            UHS         1        0    lo0

When you disconnect the second VPN all the routes pointing to 10.0.5.1 =
are removed.

If I add 10.0.5.1 as an proper alias to an interface (eg loopback) it =
seems to work as you would expect and disconnecting one VPN doesn't =
disconnect all the rest.

>> I've been working on migrating a PPTP server from FreeBSD 7.1 to =
FreeBSD 8.1.  The server is configured using PopTop (from ports) and PPP =
(/usr/sbin) rather than MPD.  (Before anybody tells me to use MPD we =
can't because it doesn't inject packets into the kernel in the same way =
and it's not possible to filter on them correctly)
>>=20
>> Basic PPTP connection works properly.=20
>>=20
>> The fun happens when I have two simultaneous users.  The first one to =
DISCONNECT deletes the routes for both of them and all PPTP traffic =
ceases.
>=20
> Just been working my way through the PPP code - which doesn't actually =
appear to have changed.
>=20
> However, the netinet/in.c does have some comments in the SVN history =
about deleting the loopback address, this appears to have been merged in =
as part of the 8 release cycle (r197231 perhaps) (though I'm not an =
expert at SVN etc)
>=20
> What should happen when there are multiple interfaces with the same =
address.  When I have two tunnels configured they show up as (eg)
>=20
> tun0: flags=3D8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1398
>        options=3D80000<LINKSTATE>
>        inet 10.0.5.1 --> 10.0.0.31 netmask 0xffffffff
>        Opened by PID 12616
>=20
> tun1: flags=3D8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1398
>        options=3D80000<LINKSTATE>
>        inet 10.0.5.1 --> 10.0.0.32 netmask 0xffffffff
>        Opened by PID 12630
>=20
> If the loop back address is 10.0.5.1 and closing one of them deletes =
the loopback what should happen?  Should it delete all routes that refer =
to 10.0.5.1?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FBC82712-5E6D-43B7-B716-87615BFCF6B3>