Skip to content

swift-cidr 0.7.1

Latest

Choose a tag to compare

@camunro camunro released this 16 Sep 15:54
Immutable release. Only release title and notes can be modified.
0.7.1
3085c1c

IPv6 literal validation

swift-cidr 0.7.1 corrects three IPv6 text-validation defects in the shared parser. Malformed input that previously parsed successfully is now rejected; valid addresses retain their existing values, formatting, and prefix context.

The parser now rejects:

  • Hextets longer than four hexadecimal digits, including zero-padded values whose numeric value fits in 16 bits, such as 00000::1.
  • A terminal single colon, such as 1:2:3:4:5:6:7:8: or ::1:.
  • A double colon that compresses no words, such as 1:2:3:4:5:6:7:8::. An embedded IPv4 tail contributes two words to this validation.

These checks follow RFC 4291 section 2.2 and apply through the existing shared parser to concrete and mixed-family addresses and networks, CIDR-qualified text, range endpoints, Codable decoding, and CIDRArgumentParser conversions, including bracketed IPv6 endpoints.

Valid compression, including exactly one omitted word, remains supported. IPv4-mapped IPv6 remains IPv6. Existing decimal leading-zero IPv4-octet acceptance is unchanged, including mixed IPv6 notation.

Compatibility

No public declarations, dependencies, signatures, stored layout, or availability have changed. Swift 6.2 remains the minimum toolchain; deployment floors remain macOS 15 and iOS 18.

Integer-backed identity, CIDR math, formatting, and valid-input Codable behavior are unchanged. Previously accepted malformed IPv6 strings now return nil from failable parsers, throw decoding errors through Codable, or fail argument parsing.

Consumers requiring this correction should declare 0.7.1 as their minimum version, rather than relying only on a resolved-file pin.

Validation

  • 225 tests across 23 suites passed on macOS Swift 6.3.3 and Linux Swift 6.2.4/6.3.3.
  • All four targets built at the macOS 15 and iOS 18 simulator deployment floors; the public API comparison against 0.7.0 reports no breaking changes.
  • All six focused parser benchmark thresholds pass unchanged; sampled allocation and ARC metrics remained zero before and after. No threshold recalibration or cross-machine speed claim.
  • The correction was integrated through PR #14, preserving the reviewed SSH-signed commit.
  • All five manual CI jobs passed on the merged release commit, including the benchmark-target build.
  • A clean consumer resolved the public 0.7.1 tag and passed malformed-input rejection and valid-address preservation checks; repeated resolution kept its lockfile stable.

These are parser correctness fixes; no exploit or downstream security impact has been established.

Full changelog: 0.7.0...0.7.1