Page MenuHomeFreeBSD

[netgraph/ng_eiface] Generate MAC address from the FreeBSD OUI range.
ClosedPublic

Authored by afedorov on Jan 14 2020, 10:44 AM.

Details

Summary

Most network pseudo interfaces (if_tuntap, if_epair ...) generate a MAC address from the FreeBSD OUI range.
ng_eiface by default sets it to 00:00:00:00:00:00. This complicates a setup. So, I don't see any reason to not generate the MAC address as other drivers do.

Test Plan

root@q1u001:~ # ngctl mkpeer eiface test ether
root@q1u001:~ # ifconfig ngeth0
ngeth0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500

options=28<VLAN_MTU,JUMBO_MTU>
ether 58:9c:fc:10:b3:3a
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

root@q1u001:~ # ngctl mkpeer eiface test ether
root@q1u001:~ # ifconfig ngeth1
ngeth1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500

options=28<VLAN_MTU,JUMBO_MTU>
ether 58:9c:fc:00:1a:00
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

afedorov created this revision.Jan 14 2020, 10:44 AM
kevans accepted this revision.Jan 14 2020, 12:13 PM

This seems like a good idea. I'm not well-versed in netgraph, but the manpage here doesn't lead me thinking I'd need to consider setting a MAC address and I certainly don't typically have to for other interfaces- solid +1.

This revision is now accepted and ready to land.Jan 14 2020, 12:13 PM

Because setting a MAC is still possible, the older scripts will not fail with this patch.

afedorov added a reviewer: ae.Jan 16 2020, 9:59 AM
This revision was automatically updated to reflect the committed changes.