summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-04-08 22:52:59 +0200
committerDmitry Kozlov <xeb@mail.ru>2014-04-11 06:47:26 +0400
commitf2c1387d79966e950c534be9f020ccbbc75f4aa3 (patch)
tree2070b7852650fdce27bbf6f8b05486b15da50d03 /accel-pppd/ppp
parent411c4f943bdfdc8ebb79582d17e93923109c95b0 (diff)
downloadaccel-ppp-f2c1387d79966e950c534be9f020ccbbc75f4aa3.tar.gz
accel-ppp-f2c1387d79966e950c534be9f020ccbbc75f4aa3.zip
l2tp: allow tunnel deletion in main reception loop
Let functions launched by l2tp_conn_read() delete the tunnel. This is done by taking a reference on conn to ensure it'll remain a valid tunnel, even after calling l2tp_tunnel_free(conn). l2tp_conn_read() now detects if conn got deleted, so that we know if the tunnel still holds a reference to itself. If it doesn't, tunnel_put() may free the tunnel and thus the triton handler we're running from. So we have to return -1 in this case. l2tp_tunnel_free() also needs to be modified: it can't safely close conn->hnd.fd anymore. Since l2tp_conn_read() relies on conn->hnd.fd being a valid file descriptor, closing it inside the reception loop would break this assumption in next iteration. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ppp')
0 files changed, 0 insertions, 0 deletions