summaryrefslogtreecommitdiff
path: root/accel-pppd/extra/ippool.c
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2012-09-07 12:36:39 +0200
committerKozlov Dmitry <xeb@mail.ru>2012-09-07 14:54:14 +0400
commitb34b73e2c86238ffb808d51d52983b84cafedb4e (patch)
tree371c5818f6f09cb32780921ac983563e4e1056ef /accel-pppd/extra/ippool.c
parent795346e2bb5d4f3dea29719d9677c1c0c2031987 (diff)
downloadaccel-ppp-xebd-b34b73e2c86238ffb808d51d52983b84cafedb4e.tar.gz
accel-ppp-xebd-b34b73e2c86238ffb808d51d52983b84cafedb4e.zip
L2TP: Handle multiple sessions per tunnel
Accept to create several sessions for each tunnel. Session IDs are generated randomly and stored in a binary search tree in their corresponding tunnel (i.e. field "sessions" of the l2tp_conn_t structure). A new mempool is defined for session allocations. Generation of the session IDs is simple but quite limited: it selects a 16 bits random ID and checks if a session with this ID already exists. If so the allocation fails and the session is closed. Otherwise the selected ID is used for the new session. So tunnels that handle many sessions may reject new ones, even if unused session IDs are available (just because the randomly choosen ID is already in use). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/extra/ippool.c')
0 files changed, 0 insertions, 0 deletions