Skip to content

Fix AnyConnect disabled timers parsing - #8

Open
inoisy wants to merge 4 commits into
SagerNet:mainfrom
inoisy:fix/cstp-disabled-timers
Open

inoisy wants to merge 4 commits into
SagerNet:mainfrom
inoisy:fix/cstp-disabled-timers

Conversation

@inoisy

@inoisy inoisy commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Problem

A Cisco gateway with dead peer detection turned off answers CONNECT with X-CSTP-DPD: disabled. The client accepts only a number or none, so the endpoint terminates right after successful authentication:

client terminated: invalid X-CSTP-DPD: disabled

Setting dpd_interval does not help: the header is parsed before the option is applied.

Upstream behavior

openconnect (cstp.c) parses these timers with atol, so disabled becomes 0.

Change

parseCSTPDuration treats disabled as 0, like none. MTU parsing and other invalid values stay strict.

Testing

  • disabled, none, empty, numeric and invalid values checked with a local test; it fails without the change.
  • Builds for linux, windows and darwin.
  • Live through sing-box 1.14.4 with this change on top of its pinned revision (cbd68c45de58), against a production Cisco gateway that sends this header: login with an OTP, pushed DNS and HTTPS work over TLS. Without the change, the same setup fails with the error above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants