19/11/2025 01:07, Thomas Monjalon:
> 18/11/2025 18:45, Robin Jarry:
> > From: Christophe Fontaine <[email protected]>
> > > Modified EUI-64 format interface identifiers are formed by inverting
> > > the "u" bit (universal/local bit in IEEE EUI-64 terminology) when
> > > forming the interface identifier from IEEE EUI-64 identifiers.
> [...]
> > -   ip->a[8] = mac->addr_bytes[0];
> > +   ip->a[8] = mac->addr_bytes[0] ^ RTE_ETHER_LOCAL_ADMIN_ADDR;
> 
> In all other places, we use the operator OR, so I'm not sure about this XOR.
> Also, rte_is_universal_ether_addr() and rte_is_local_admin_ether_addr()
> are comparing this bit with 0.
> Is this bit always 0 by default in MAC addresses?

After checking with Stephen, it appears that XOR is really desired.
This bit must be inverted, so 0 is local and 1 is universal.

Adding this comment in the code to avoid confusion in future:
    /*
     * The "u" bit (universal/local bit in IEEE EUI-64 terminology)
     * must be inverted for IPv6 link local address.
     * 0 means local scope, 1 means universal scope.
     */

Applied, thanks.


Reply via email to