Page MenuHomeFreeBSD

bridge: Use %D identifier to format MAC address
ClosedPublic

Authored by zlei on Apr 13 2023, 3:13 AM.
Tags
None
Referenced Files
F131791139: D39542.id120238.diff
Sat, Oct 11, 4:52 AM
F131753168: D39542.id120238.diff
Fri, Oct 10, 9:43 PM
F131753166: D39542.id120303.diff
Fri, Oct 10, 9:43 PM
F131753165: D39542.id.diff
Fri, Oct 10, 9:43 PM
F131723265: D39542.diff
Fri, Oct 10, 3:56 PM
Unknown Object (File)
Sep 3 2025, 1:13 AM
Unknown Object (File)
Aug 10 2025, 5:22 PM
Unknown Object (File)
Jul 19 2025, 1:29 PM

Details

Summary

It is shorter and more readable.

No functional change intended.

Fixes: 2d3614fb132b bridge: Log MAC address port flapping
MFC after: 8 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

zlei requested review of this revision.Apr 13 2023, 3:13 AM

I did not know about %D. It's good to learn things :)

This revision is now accepted and ready to land.Apr 13 2023, 6:58 AM
In D39542#900188, @kp wrote:

I did not know about %D. It's good to learn things :)

I found that while hacking the VLAN PCP bugs ;)

See sys/net/if_ethersubr.c:

/*
 * Perform common duties while attaching to interface list
 */
void
ether_ifattach(struct ifnet *ifp, const u_int8_t *lla)
{
...
        if (i != ifp->if_addrlen)
                if_printf(ifp, "Ethernet address: %6D\n", lla, ":");
...
}