Files
freebsd/share/examples
Devin Teske 19b0b1f648 examples/jails: Encode ifnames used as derive_mac counters
derive_mac keeps a per-parent branch index in a global named from the
parent interface so the N nibble can increment when the same PHY is
presented more than once. That name must be a POSIX identifier; a
vlan-style parent (em0.20) is not.

Encode the ifname first (alnum unchanged, every other byte as _HH) so
the lookup stays a symbol-table hit and em0.20 does not collide with
em0_20. Same change in jib (9.2) and jng (9.4).

In jng, also address netgraph by node name. ngctl(8) treats `.' and
`:' as control characters, so ng_ether(4) names its node after the
sanitized ifname (vtnet0.20 becomes vtnet0_20). Sanitize the parent
ifname where it enters and use that for every ngctl call; ifconfig(8)
and derive_mac keep the real name. Previously jng failed outright on
such parents where jib did not.

PR:		291143
Reported by:	Victor <[email protected]>
MFC after:	1 week
Reviewed by:	jlduran
Differential Revision:	https://reviews.freebsd.org/D59326
2026-09-02 23:17:52 -07:00
..
…
…
…
…
2025-12-16 05:48:58 +00:00
2026-08-14 23:09:08 +08:00
…
…
…
…