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
F96479392: D39542.diff
Wed, Sep 25, 3:13 AM
Unknown Object (File)
Mon, Sep 23, 5:29 PM
Unknown Object (File)
Mon, Sep 23, 5:29 PM
Unknown Object (File)
Mon, Sep 23, 5:29 PM
Unknown Object (File)
Mon, Sep 23, 5:29 PM
Unknown Object (File)
Sat, Sep 21, 10:27 AM
Unknown Object (File)
Sat, Sep 21, 2:10 AM
Unknown Object (File)
Wed, Sep 18, 10:29 AM

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, ":");
...
}