Repository navigation
Conversation
Remember the full option string at the connection for use in reuse matching and cf-socket binding. Parse the string when set for syntax check, but remember the unparsed version and use that in connection matching. Parse that string again when the socket is set up.
bagder
approved these changes
Oct 9, 2026
There was a problem hiding this comment.
🟡 Changes recommended
The new early return disables CURLOPT_LOCALPORT binding when no interface is configured.
2 open findings
What changed in this PR
Updates CURLOPT_INTERFACE handling so connection reuse compares the complete option string and socket binding parses it when needed.
Changes:
- Stores the original interface option on connections.
- Requires exact interface matches for reuse.
- Defers interface parsing until socket binding.
| File | Description |
|---|---|
lib/urldata.h |
Consolidates interface option storage. |
lib/url.c |
Updates connection allocation, cleanup, and reuse matching. |
lib/setopt.c |
Validates and stores the original option string. |
lib/cf-socket.c |
Supports validation-only parsing and deferred binding parsing. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- conn match: localportrange only takes effect when localport is set - cf-socket: do not early exit out when no interface_op is set
dkarpov1970
pushed a commit
to dkarpov1970/curl
that referenced
this pull request
Nov 18, 2026
Remember the full option string at the connection for use in reuse matching and cf-socket binding. Parse the string when set for syntax check, but remember the unparsed version and use that in connection matching. Parse that string again when the socket is set up. Closes curl#23326 Backport notes: - CVE-2026-107929 (local interface connection reuse mixup): the matching change is kept whole. - The release lacks CURL_EASY_STR_SET() (c8df3de). CURLOPT_INTERFACE still parses into STRING_DEVICE, STRING_INTERFACE and STRING_BINDHOST, and also keeps the raw string in the new STRING_INTERFACE_OPT, which conn->interface_opts holds and url_match_connect_config() compares. - Dropped the lib/cf-socket.c change: the release binds from the strings setopt already parsed. (cherry picked from commit d37d79d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Remember the full option string at the connection for use in reuse matching and cf-socket binding.
Parse the string when set for syntax check, but remember the unparsed version and use that in connection matching. For connection reuse, interface options must full match (both ways).
Parse that string again when the socket is set up.