Skip to content

Use SystemPath for PacketFilter - #18

Closed
chrisgeo wants to merge 0 commit into
mainfrom
feat/chaos-1449-packetfilter-filepath
Closed

Use SystemPath for PacketFilter#18
chrisgeo wants to merge 0 commit into
mainfrom
feat/chaos-1449-packetfilter-filepath

Conversation

@chrisgeo

@chrisgeo chrisgeo commented May 7, 2026

Copy link
Copy Markdown

Summary

Converts PacketFilter from URL to SystemPackage.FilePath for filesystem path handling, mirroring the pattern landed in apple#1480 for HostDNSResolver.

Changes

  • configURL / anchorsURLconfigPath / anchorsPath (FilePath)
  • defaultConfigPath / defaultAnchorsPath now FilePath
  • FileManager calls switch from atPath: url.path to atPath: path.string
  • Test uses String(contentsOfFile: path.string, …) in place of String(contentsOf: URL, …)

Out of scope

  • Process.executableURL = URL(fileURLWithPath: "/sbin/pfctl")Foundation.Process requires URL, kept as-is.

Context

Test plan

  • swift test --filter PacketFilterTest — both tests pass (testRedirectRuleUpdate, testPacketFilterReinitialize)
  • swift test --filter ContainerAPIClientTests — all 171 tests in 11 suites pass (no neighbor regressions)
  • swift-format lint --strict --configuration .swift-format-nolint — clean
  • Full project builds (warnings-as-errors: on)

Next steps

After merge here, forward to apple/container as the upstream PR (filing the upstream [Request]: TECH DEBT - Convert PacketFilter to FilePath issue first, mirroring apple#1479).

@linear

linear Bot commented May 7, 2026

Copy link
Copy Markdown

CHAOS-1449

@chrisgeo chrisgeo closed this May 8, 2026
@chrisgeo
chrisgeo force-pushed the feat/chaos-1449-packetfilter-filepath branch from db825ef to beb1592 Compare May 8, 2026 22:14
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.

1 participant