PingKit 0.5.0
PingKit 0.5.0 adds dual-stack IPv6 ping and a formal pingkit CLI, and
folds in the previously unreleased 0.4.0 work (outgoing TTL + .sent
events). This is a breaking minor: see below before upgrading.
Highlights
IPv6 ping (dual-stack)
- Full ICMPv6 echo over unprivileged datagram sockets, with hop-limit
ancillary data and source address viarecvmsg. PingConfiguration.AddressFamily—.automatic(follows the system's
getaddrinfoordering, so hostnames resolve over DNS64/NAT64),.ipv4,
or.ipv6. IPv6 literals and scoped link-local addresses are supported.- ICMPv6 Destination Unreachable, Time Exceeded, Packet Too Big, and
Parameter Problem map to typedPingResponseevents. - On Darwin the socket sets
ICMP6_FILTERso it only wakes for the
message types ping consumes (not NDP/RA multicast). Tracerremains IPv4-only in this release.
Outgoing TTL / hop limit (was 0.4.0)
PingConfiguration.timeToLive(1...255;nilkeeps the system default),
applied as IPv4 TTL or IPv6 unicast hop limit.- CLI
-msets the outgoing TTL in ping mode.
.sent probe events (was 0.4.0)
PingResponse.sent(sequence:)fires as each echo request leaves the
socket, before that sequence's terminal event — so a UI can insert a
pending row per probe and update it in place.
Formal CLI
swift-argument-parser-basedpingkitcommand withping/trace
subcommands, typed validation, and generated help.-4/-6force the
address family. The dependency links only into the CLI target; the
PingKitlibrary stays zero-dependency.
Breaking changes
PingReply.fromis nowIPAddress(wasIPv4Endpoint).PingResponsegains.sent,.packetTooBig, and.parameterProblem
cases — exhaustiveswitches must handle them.- The executable product is named
pingkit-cli(the command is still
pingkit); the oldping-cliproduct is removed.
Notes
unreachable(code:)codes are numbered differently by IPv4 vs IPv6;
interpretcodeaccording to the address family the run resolved to.- Verified on macOS, iOS Simulator (including ICMPv6 loopback integration
tests), and Linux Swift 6.0 / 6.1.