mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-11 09:16:59 +08:00
Fix multiple session disconnect when max-same-clients is 0
max-same-clients is used to limit the number of outstanding sessions (cookies). If set to 0, it means an unlimited number of active cookies can be owned by each user. But it doesn't mean that the same cookie can be reused for multiple CSTP connections with different IPs, as the protocol does not normally work this way.
This commit is contained in:
committed by
Nikos Mavrogiannopoulos
parent
791d776320
commit
1176d2b7b8
@@ -472,9 +472,6 @@ int check_multiple_users(main_server_st *s, struct proc_st* proc)
|
||||
struct proc_st *ctmp = NULL, *cpos;
|
||||
unsigned int entries = 1; /* that one */
|
||||
|
||||
if (s->config->max_same_clients == 0)
|
||||
return 0; /* ok */
|
||||
|
||||
list_for_each_safe(&s->clist.head, ctmp, cpos, list) {
|
||||
if (ctmp != proc) {
|
||||
if (memcmp(proc->cookie, ctmp->cookie, sizeof(proc->cookie)) == 0) {
|
||||
@@ -492,7 +489,7 @@ unsigned int entries = 1; /* that one */
|
||||
}
|
||||
}
|
||||
|
||||
if (entries > s->config->max_same_clients)
|
||||
if (s->config->max_same_clients && entries > s->config->max_same_clients)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user