Skip to content

Fix IPv6 zone identifier parsing in module list requests - #1657

Merged
oferchen merged 1 commit into
masterfrom
fix-ipv6-zone-identifier-test-failures
Oct 30, 2025
Merged

oferchen merged 1 commit into
masterfrom
fix-ipv6-zone-identifier-test-failures

Conversation

@oferchen

@oferchen oferchen commented Oct 30, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • allow IPv6 zone identifiers to pass through module list host decoding without tripping invalid percent-encoding errors
  • restrict daemon host/port parsing so IPv6 literals with explicit ports must be bracketed and ensure host-specific percent-encoding diagnostics

Testing

  • cargo test -p rsync-core module_list_request_parses_ipv6_zone_identifier
  • cargo test -p rsync-core module_list_request_supports_raw_ipv6_zone_identifier
  • cargo test -p rsync-core module_list_request_rejects_truncated_percent_encoding

@oferchen
oferchen merged commit e66dc65 into master Oct 30, 2025
@oferchen
oferchen deleted the fix-ipv6-zone-identifier-test-failures branch October 30, 2025 10:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 248 to +256
if let Some((host, port)) = split_host_port(input) {
let port = port
.parse::<u16>()
.map_err(|_| daemon_error("invalid daemon port", FEATURE_UNAVAILABLE_EXIT_CODE))?;
let host = decode_host_component(host)?;
let address = DaemonAddress::new(host, port)?;
return Ok(ParsedDaemonTarget { address, username });
let host_contains_colon = host.contains(':');
let port_is_digits = !port.is_empty() && port.chars().all(|ch| ch.is_ascii_digit());

if port_is_digits {
if host_contains_colon {
return Err(daemon_error(
"IPv6 daemon addresses must be enclosed in brackets",
FEATURE_UNAVAILABLE_EXIT_CODE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject numeric-suffixed IPv6 literals without ports

The explicit-port detection in parse_host_port now looks at the substring after the last : and treats it as a port whenever it contains only digits. For an unbracketed IPv6 literal whose final segment is numeric (rsync://2001:db8::1/, rsync://::1/, etc.), split_host_port returns that last segment as the port, port_is_digits becomes true, and the code errors with “IPv6 daemon addresses must be enclosed in brackets”. These addresses do not include an explicit port and previously resolved to the default port, so the new check rejects a valid form and only affects IPv6 hosts whose trailing segment happens to be decimal digits. IPv6 literals ending with hex letters still work, which makes the behavior inconsistent. The port detection should distinguish “IPv6 literal with no port” from “literal with a numeric port” rather than flagging all trailing decimal segments.

Useful? React with 👍 / 👎.

oferchen added a commit that referenced this pull request May 5, 2026
Mirrors the IoUringDiskBatch and IocpDiskBatch shape so the disk-commit
thread keeps a single calling convention across platforms; covers the
kqueue model, AsyncFileWriter trait mapping, dispatch wiring, limits
vs io_uring, and the migration sequence through #1657 / #1659 / #1386.
oferchen added a commit that referenced this pull request May 5, 2026
Static, code-grounded audit of the fast_io fallback on macOS compared
to the Linux io_uring path and the post-#1868 Windows IOCP path.
Inventories every public copy/write/probe entry point with file:LINE,
documents the inferred per-file syscall budget, identifies which
io_uring features have no macOS analogue, and ranks the near-term
mitigations (#1657 pwritev+F_NOCACHE, #1385 kqueue backend, macOS
sendfile arm) by inferred payoff per unit of effort.
oferchen added a commit that referenced this pull request May 5, 2026
Design note for the near-term macOS-optimized fallback that pairs
F_NOCACHE on the destination fd with writev for the buffered-write
path. Composes with the longer-term kqueue backend (#1385) and fills
in the WritevAsyncWriter branch named in the AsyncFileWriter audit
(#1655).
oferchen added a commit that referenced this pull request May 13, 2026
…) (#3998)

* feat(fast_io): add macOS F_NOCACHE + writev optimized write path (#1657)

Add a macOS-specific file writer that combines two optimizations for
large sequential writes:

- F_NOCACHE via fcntl bypasses the unified buffer cache for files above
  1 MB, reducing memory pressure without alignment requirements.
- writev scatter-gather I/O batches multiple buffers into a single
  syscall, reducing transition overhead.

Small files below the threshold use standard buffered I/O. Non-macOS
platforms compile a stub that delegates to BufWriter. The module follows
the same cfg-gated pattern as io_uring and IOCP with platform stubs.

* fix: replace assertions on constants with value equality check

Clippy flags `assert!(CONST > 0)` as `assert!(true)` since the
compiler evaluates and optimizes it away. Use `assert_eq!` with
the expected value instead.
oferchen added a commit that referenced this pull request May 18, 2026
Mirrors the IoUringDiskBatch and IocpDiskBatch shape so the disk-commit
thread keeps a single calling convention across platforms; covers the
kqueue model, AsyncFileWriter trait mapping, dispatch wiring, limits
vs io_uring, and the migration sequence through #1657 / #1659 / #1386.
oferchen added a commit that referenced this pull request May 18, 2026
Static, code-grounded audit of the fast_io fallback on macOS compared
to the Linux io_uring path and the post-#1868 Windows IOCP path.
Inventories every public copy/write/probe entry point with file:LINE,
documents the inferred per-file syscall budget, identifies which
io_uring features have no macOS analogue, and ranks the near-term
mitigations (#1657 pwritev+F_NOCACHE, #1385 kqueue backend, macOS
sendfile arm) by inferred payoff per unit of effort.
oferchen added a commit that referenced this pull request May 18, 2026
Design note for the near-term macOS-optimized fallback that pairs
F_NOCACHE on the destination fd with writev for the buffered-write
path. Composes with the longer-term kqueue backend (#1385) and fills
in the WritevAsyncWriter branch named in the AsyncFileWriter audit
(#1655).
oferchen added a commit that referenced this pull request May 18, 2026
…) (#3998)

* feat(fast_io): add macOS F_NOCACHE + writev optimized write path (#1657)

Add a macOS-specific file writer that combines two optimizations for
large sequential writes:

- F_NOCACHE via fcntl bypasses the unified buffer cache for files above
  1 MB, reducing memory pressure without alignment requirements.
- writev scatter-gather I/O batches multiple buffers into a single
  syscall, reducing transition overhead.

Small files below the threshold use standard buffered I/O. Non-macOS
platforms compile a stub that delegates to BufWriter. The module follows
the same cfg-gated pattern as io_uring and IOCP with platform stubs.

* fix: replace assertions on constants with value equality check

Clippy flags `assert!(CONST > 0)` as `assert!(true)` since the
compiler evaluates and optimizes it away. Use `assert_eq!` with
the expected value instead.
oferchen added a commit that referenced this pull request Aug 24, 2026
…) (#3998)

* feat(fast_io): add macOS F_NOCACHE + writev optimized write path (#1657)

Add a macOS-specific file writer that combines two optimizations for
large sequential writes:

- F_NOCACHE via fcntl bypasses the unified buffer cache for files above
  1 MB, reducing memory pressure without alignment requirements.
- writev scatter-gather I/O batches multiple buffers into a single
  syscall, reducing transition overhead.

Small files below the threshold use standard buffered I/O. Non-macOS
platforms compile a stub that delegates to BufWriter. The module follows
the same cfg-gated pattern as io_uring and IOCP with platform stubs.

* fix: replace assertions on constants with value equality check

Clippy flags `assert!(CONST > 0)` as `assert!(true)` since the
compiler evaluates and optimizes it away. Use `assert_eq!` with
the expected value instead.
oferchen added a commit that referenced this pull request Aug 24, 2026
Mirrors the IoUringDiskBatch and IocpDiskBatch shape so the disk-commit
thread keeps a single calling convention across platforms; covers the
kqueue model, AsyncFileWriter trait mapping, dispatch wiring, limits
vs io_uring, and the migration sequence through #1657 / #1659 / #1386.
oferchen added a commit that referenced this pull request Aug 24, 2026
Static, code-grounded audit of the fast_io fallback on macOS compared
to the Linux io_uring path and the post-#1868 Windows IOCP path.
Inventories every public copy/write/probe entry point with file:LINE,
documents the inferred per-file syscall budget, identifies which
io_uring features have no macOS analogue, and ranks the near-term
mitigations (#1657 pwritev+F_NOCACHE, #1385 kqueue backend, macOS
sendfile arm) by inferred payoff per unit of effort.
oferchen added a commit that referenced this pull request Aug 24, 2026
Design note for the near-term macOS-optimized fallback that pairs
F_NOCACHE on the destination fd with writev for the buffered-write
path. Composes with the longer-term kqueue backend (#1385) and fills
in the WritevAsyncWriter branch named in the AsyncFileWriter audit
(#1655).
oferchen added a commit that referenced this pull request Aug 24, 2026
…) (#3998)

* feat(fast_io): add macOS F_NOCACHE + writev optimized write path (#1657)

Add a macOS-specific file writer that combines two optimizations for
large sequential writes:

- F_NOCACHE via fcntl bypasses the unified buffer cache for files above
  1 MB, reducing memory pressure without alignment requirements.
- writev scatter-gather I/O batches multiple buffers into a single
  syscall, reducing transition overhead.

Small files below the threshold use standard buffered I/O. Non-macOS
platforms compile a stub that delegates to BufWriter. The module follows
the same cfg-gated pattern as io_uring and IOCP with platform stubs.

* fix: replace assertions on constants with value equality check

Clippy flags `assert!(CONST > 0)` as `assert!(true)` since the
compiler evaluates and optimizes it away. Use `assert_eq!` with
the expected value instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant