diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2014-04-08 22:53:42 +0200 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-04-11 06:47:26 +0400 |
commit | 250167afcf5918d8bd310cd887a0f554eac9e8b1 (patch) | |
tree | 6e032df9f436537eedf194fc12a84f028455497d /crypto | |
parent | 3448534c7fc579793840af199ae97f8184e99aa1 (diff) | |
download | accel-ppp-xebd-250167afcf5918d8bd310cd887a0f554eac9e8b1.tar.gz accel-ppp-xebd-250167afcf5918d8bd310cd887a0f554eac9e8b1.zip |
l2tp: automatically delete tunnel if disconnection fails
Let l2tp_tunnel_disconnect() delete the tunnel when an error occurs.
Return an int to indicate if conn has been deleted.
Most callers are compatible with this new behaviour, either because
they never use the tunnel after disconnection or because they hold
a reference on the tunnel.
A few callers need to be adapted though:
-l2tp_conn_close() calls l2tp_tunnel_disconnect() to properly inform
the peer of tunnel disconnection. But it also deletes the tunnel
immediately, no matter if StopCCN message was sent or not. Since
l2tp_conn_close() doesn't hold a reference on the tunnel, care must
be taken not to access the tunnel if it was deleted by
l2tp_tunnel_disconnect().
Since immediate deletion isn't required, the l2tp_tunnel_free() call
is simply removed. The normal disconnection process is now followed,
with detection and retransmission of lost messages, acknowledgment
handling, etc.
-situation is similar for l2tp_tunnel_timeout() and handled in the
same way.
This patch also deletes tunnel's sessions, as well as the establishment
and hello timers. These are of no use once the tunnel enters the
disconnection process.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions