Skip to content

v22.0.1

Latest

Choose a tag to compare

@brandonlehmann brandonlehmann released this 24 May 02:36
v22.0.1
39c3223

What's Changed

Breaking changes

  • setTTL removedMulticastSocket.setTTL(ttl) is gone. The library hardcodes IP_MULTICAST_TTL = 255 at bind so the RFC 6762 §11 outbound invariant cannot be silently broken at runtime.

RFC 6762 §11

  • Multicast-destination exemption now honored — Packets received on the shared multicast socket are accepted regardless of source IP, per RFC 6762 §11's carve-out for multicast-destination packets. This fixes cross-subnet-overlay multicast traffic that was previously being dropped. Packets received on per-interface unicast sockets still receive the source-subnet check.
  • README §RFC 6762 §11 rewritten — Crisp SHOULD/MUST mapping, multicast-destination exemption documented, explicit note that the IP_RECVTTL gap in Node's dgram is upstream and not worked around from userspace.

Input validation

  • multicastGroup validated upfront — A non-multicast address now throws multicastGroup X is not a multicast address before any socket allocation, instead of surfacing as a late addMembership EADDRNOTAVAIL. New is_multicast helper is exported from @gibme/multicast/helpers.
  • compare_IP_addresses throws on mixed-family inputs — Previously returned a meaningless ordering when comparing IPv4 to IPv6.

IPv6 zone-id handling

  • fromSelf is now zone-id-tolerant — Node 22's dgram delivers IPv6 link-local rinfo.address with a %iface suffix; the prior exact-string match missed it. dispatch_message now strips the suffix before comparing against bound addresses.
  • srcAddress and host normalized — The same zone-id strip is applied at the three sites that match against bound addresses (create() host check, send() unicast-path, send() multicast-path).

Helpers

  • get_addresses dedup fixed — Was [...new Set(addresses)] which deduped by object reference (a no-op for freshly-constructed instances); now a Map keyed by .address string.
  • get_addresses requires addr.cidr — Throws if os.networkInterfaces() returns an entry without it. Dead-code netmask_to_prefix fallback (IPv4-only dotted-decimal parser) removed.
  • is_on_local_link IPv6 link-local comment — Rewritten to acknowledge both RFC 4291 §2.4 (FE80::/10 reserved prefix) and §2.5.6 (link-local format requires middle 54 bits zero), and explain why the wider /10 check is used for inbound filtering.

Documentation

  • JSDoc on send() and Send.Options.useMulticastSocket — Concurrency note: combining useMulticastSocket: true with srcAddress mutates per-socket state on the shared multicast socket via setMulticastInterface. Concurrent calls race; serialize them in the caller, or use the default per-interface unicast path (race-free).
  • JSDoc on setMulticastLoopback — Explains that it only mutates IP_MULTICAST_LOOP on the shared multicast socket and that the authoritative user-visible loopback gate is the check inside dispatch_message.

Tests

101/101 pass. Added 8 regression tests under a new input validation and dispatch hardening block covering all of the above.

Full Changelog: v22.0.0...v22.0.1