Internet Exchange port policies commonly forbid non-unicast frames on
the peering fabric, with a narrow exception for broadcast ARP and
ICMPv6 Neighbor Discovery. MLD is ICMPv6 but is not ND, so MLD reports
fall under the prohibition.
There is currently no supported way to hold an IPv6 address on a
FreeBSD interface without emitting MLD. Solicited-node group
membership is mandatory (RFC 4291 2.7.1, RFC 4861 7.2.1) and membership
obliges reporting (RFC 3810 5). The MLD sysctls select protocol
version behaviour rather than disabling reporting, and are not
per-interface. The only remedy today is an egress packet filter, which
every operator at an exchange must rediscover independently --
typically after being notified by the exchange that they are in
violation.
Add ND6_IFF_NO_MLD, settable as "ifconfig <if> inet6 no_mld",
following the existing precedent of no_dad, no_radr and
no_prefer_iface: per-interface, opt-in, default off, deviating from an
IPv6 RFC where operational policy requires it. Per-interface rather
than a sysctl because an operator wants suppression on peering ports
and normal behaviour on LAN ports.
The gate is in mld_dispatch_packet(), through which every transmitted
MLD packet passes -- MLDv1 reports and Done via
mld_v1_transmit_report(), MLDv2 reports via mld_dispatch_queue().
Gating at dispatch rather than in the state machine leaves group state
and bookkeeping untouched: the stack believes it transmitted, which is
the behaviour a packet filter produces today and is therefore the
semantics already proven in the field. Reception is unaffected. The
check follows the access idiom established in 576ee62dd2e5.
Intentional suppression is traced via KTR_MLD and not counted as an
output error.
Bits 0x200 and 0x400 are left vacant: they were ND6_IFF_IPV6_ONLY and
ND6_IFF_IPV6_ONLY_MANUAL in released kernels, and the nd6 flag word is
visible to userland, so reusing them would cause older ifconfig
binaries to mislabel the flag.
The equivalent behaviour, implemented as an ipfw egress filter, has
run in production on AS28585 across eight IX.br localities: no MLD on
any peering VLAN, ND unaffected, all BGP sessions established, and the
exchange confirmed the traffic ceased.
Question for glebius@: with the ND context now embedded in in6_ifextra (576ee62dd2e5), a dedicated mld_ifsoftc field and an nd6 flag are equally local. I chose the nd6 flag for ifconfig consistency — happy to move it if you prefer.