Page MenuHomeFreeBSD

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

Authored by afedorov on Jan 14 2020, 10:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 1:07 PM
Unknown Object (File)
Mon, Dec 9, 6:59 PM
Unknown Object (File)
Nov 8 2024, 2:34 AM
Unknown Object (File)
Nov 5 2024, 11:55 AM
Unknown Object (File)
Oct 27 2024, 1:57 AM
Unknown Object (File)
Oct 19 2024, 5:54 AM
Unknown Object (File)
Oct 4 2024, 11:34 PM
Unknown Object (File)
Oct 4 2024, 4:29 PM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.

This revision was automatically updated to reflect the committed changes.