mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-09 16:26:59 +08:00
Merge branch 'tmp-fix-anyconnect-disconnect' into 'master'
Distinguish the bye packet interpretation Closes #281 See merge request openconnect/ocserv!162
This commit is contained in:
@@ -170,6 +170,8 @@ const char *discon_reason_to_str(unsigned reason)
|
||||
return "unspecified";
|
||||
case REASON_USER_DISCONNECT:
|
||||
return "user disconnected";
|
||||
case REASON_TEMP_DISCONNECT:
|
||||
return "anyconnect client disconnected";
|
||||
case REASON_SERVER_DISCONNECT:
|
||||
return "server disconnected";
|
||||
case REASON_IDLE_TIMEOUT:
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define REASON_DPD_TIMEOUT 5
|
||||
#define REASON_ERROR 6
|
||||
#define REASON_SESSION_TIMEOUT 7
|
||||
#define REASON_TEMP_DISCONNECT 8
|
||||
|
||||
/* Timeout (secs) for communication between main and sec-mod */
|
||||
#define MAIN_SEC_MOD_TIMEOUT 120
|
||||
|
||||
@@ -2514,7 +2514,21 @@ static int parse_data(struct worker_st *ws, uint8_t *buf, size_t buf_size,
|
||||
break;
|
||||
case AC_PKT_DISCONN:
|
||||
oclog(ws, LOG_INFO, "received BYE packet; exiting");
|
||||
exit_worker_reason(ws, REASON_USER_DISCONNECT);
|
||||
/* In openconnect the BYE packet indicates an explicit
|
||||
* user disconnect. In anyconnect clients it may indicate
|
||||
* an intention to reconnect (e.g., because network was
|
||||
* changed). We separate the error codes to ensure we do
|
||||
* do not interpret the intention incorrectly (see #281). */
|
||||
if (plain_size > 0 && plain[0] == 0xb0) {
|
||||
exit_worker_reason(ws, REASON_USER_DISCONNECT);
|
||||
} else {
|
||||
if (plain_size > 0) {
|
||||
oclog(ws, LOG_DEBUG, "bye packet with payload: %u/%.2x", (unsigned)plain_size, plain[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
exit_worker_reason(ws, REASON_TEMP_DISCONNECT);
|
||||
}
|
||||
break;
|
||||
case AC_PKT_COMPRESSED:
|
||||
/* decompress */
|
||||
|
||||
Reference in New Issue
Block a user